package ChangeKey;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;


public class MusicKeyAlter {

    //判断锁
    private static int firstCheck = 0;


    private static final String UP_B_KEY = "B#";
    private static final String C_KEY = "C";
    private static final String UP_C_KEY = "C#";
    private static final String DOWN_D_KEY = "Db";
    private static final String D_KEY = "D";
    private static final String UP_D_KEY = "D#";
    private static final String DOWN_E_KEY = "Eb";
    private static final String E_KEY = "E";
    private static final String DOWN_F_KEY = "Fb";
    private static final String F_KEY = "F";
    private static final String UP_E_KEY = "E#";
    private static final String UP_F_KEY = "F#";
    private static final String DOWN_G_KEY = "Gb";
    private static final String G_KEY = "G";
    private static final String UP_G_KEY = "G#";
    private static final String DOWN_A_KEY = "Ab";
    private static final String A_KEY = "A";
    private static final String UP_A_KEY = "A#";
    private static final String DOWN_B_KEY = "Bb";
    private static final String B_KEY = "B";
    private static final String DOWN_C_KEY = "Cb";

    //输出---------------------------------------------------------------------------------------
    private static void afterAlterIfEqualOrFinishAlterThenOutput(List<String> originalAllPitch
            , String originalKey
            , int pat
            , String hopingKey) {

        if (firstCheck == 0) {
            System.out.println("1=" + originalKey);
            firstCheck = 1;
        } else {
            System.out.println("1=" + hopingKey);
            firstCheck = 0;
        }
        symbol(originalAllPitch, pat);

        if (checkKeyEqual(originalKey, hopingKey)) {
            System.out.println();
            System.out.println("保持原调式");
        } else System.out.println();
    }


    /*
     * 抽取afterAlterIfEqualOrFinishAlterThenOutput和realPitch重复的输出
     * symbol:用于格式化输出
     */
    private static void symbol(List<String> originalAllPitch, int pat) {
        int size = originalAllPitch.size();
        int count = 0;
        int max = size - 1;
        if (pat == 1) {
            int outNum = size / pat;
            for (int i = 0; i < outNum; i++) {
                for (int j = 0; j < pat; j++) {
                    if (count > max) break;
                    System.out.print("|" + originalAllPitch.get(count) + "|");
                    count++;
                }
                System.out.println();
            }
        }
        if (size % pat == 0 && pat != 1) {
            int outNum = size / pat;
            for (int i = 0; i < outNum; i++) {
                for (int j = 0; j < pat; j++) {
                    if (j == pat - 1) {
                        System.out.print(originalAllPitch.get(count) + "|");
                        break;
                    } else if (j == 0) {
                        System.out.print("|" + originalAllPitch.get(count) + " ");
                    } else {
                        System.out.print(originalAllPitch.get(count) + " ");
                    }
                    count++;
                }
                System.out.println();
            }
        } else if (size % pat != 0) {
            int outNum = size / pat + 1;
            loop:
            for (int i = 0; i < outNum; i++) {
                for (int j = 0; j < pat; j++) {
                    if (count >= size) {
                        System.out.print("|");
                        break loop;
                    } else if (j == pat - 1) {
                        System.out.print(originalAllPitch.get(count) + "|");
                        count++;
                        break;
                    } else if (j == 0) {
                        System.out.print("|" + originalAllPitch.get(count) + " ");
                    } else {
                        System.out.print(originalAllPitch.get(count) + " ");
                    }
                    count++;
                }
                System.out.println();
            }
        }


    }

    private static void symbolOverride(List<String> originalAllPitch, int pat, String hopingKey) {
        System.out.println("1=" + hopingKey);
        int size = originalAllPitch.size();
        int count = 0;
        int max = size - 1;
        if (pat == 1) {
            int outNum = size / pat;
            for (int i = 0; i < outNum; i++) {
                for (int j = 0; j < pat; j++) {
                    if (count > max) break;
                    System.out.print("|" + originalAllPitch.get(count) + "|");
                    count++;
                }
                System.out.println();
            }
        }
        if (size % pat == 0 && pat != 1) {
            int outNum = size / pat;
            for (int i = 0; i < outNum; i++) {
                for (int j = 0; j < pat; j++) {
                    if (j == pat - 1) {
                        System.out.print(originalAllPitch.get(count) + "|");
                        break;
                    } else if (j == 0) {
                        System.out.print("|" + originalAllPitch.get(count) + " ");
                    } else {
                        System.out.print(originalAllPitch.get(count) + " ");
                    }
                    count++;
                }
                System.out.println();
            }
        } else if (size % pat != 0) {
            int outNum = size / pat + 1;
            loop:
            for (int i = 0; i < outNum; i++) {
                for (int j = 0; j < pat; j++) {
                    if (count >= size) {
                        System.out.print("|");
                        break loop;
                    } else if (j == pat - 1) {
                        System.out.print(originalAllPitch.get(count) + "|");
                        count++;
                        break;
                    } else if (j == 0) {
                        System.out.print("|" + originalAllPitch.get(count) + " ");
                    } else {
                        System.out.print(originalAllPitch.get(count) + " ");
                    }
                    count++;
                }
                System.out.println();
            }
        }

        System.out.println();
    }

    private static void realPitch(List<String> originalAllPitch, int pat) {
        symbol(originalAllPitch, pat);
        System.out.println();
    }

    //输出---------------------------------------------------------------------------------------


    private static boolean checkKeyEqual(String originalKey, String hopingKey) {
        if ((originalKey.equals(UP_B_KEY) && hopingKey.equals(C_KEY))
                || (originalKey.equals(C_KEY) && hopingKey.equals(UP_B_KEY)))
            return true;
        else if ((originalKey.equals(UP_C_KEY) && hopingKey.equals(DOWN_D_KEY))
                || (originalKey.equals(DOWN_D_KEY) && hopingKey.equals(UP_C_KEY)))
            return true;
        else if ((originalKey.equals(UP_D_KEY) && hopingKey.equals(DOWN_E_KEY))
                || (originalKey.equals(DOWN_E_KEY) && hopingKey.equals(UP_D_KEY)))
            return true;
        else if ((originalKey.equals(E_KEY) && hopingKey.equals(DOWN_F_KEY))
                || (originalKey.equals(DOWN_F_KEY) && hopingKey.equals(E_KEY)))
            return true;
        else if ((originalKey.equals(F_KEY) && hopingKey.equals(UP_E_KEY))
                || (originalKey.equals(UP_E_KEY) && hopingKey.equals(F_KEY)))
            return true;
        else if ((originalKey.equals(UP_F_KEY) && hopingKey.equals(DOWN_G_KEY))
                || (originalKey.equals(DOWN_G_KEY) && hopingKey.equals(UP_F_KEY)))
            return true;
        else if ((originalKey.equals(UP_G_KEY) && hopingKey.equals(DOWN_A_KEY))
                || (originalKey.equals(DOWN_A_KEY) && hopingKey.equals(UP_G_KEY)))
            return true;
        else if ((originalKey.equals(UP_A_KEY) && hopingKey.equals(DOWN_B_KEY))
                || (originalKey.equals(DOWN_B_KEY) && hopingKey.equals(UP_A_KEY)))
            return true;
        else if ((originalKey.equals(B_KEY) && hopingKey.equals(DOWN_C_KEY))
                || (originalKey.equals(DOWN_C_KEY) && hopingKey.equals(B_KEY)))
            return true;
        else if (originalKey.equals(hopingKey))
            return true;
        return false;
    }


    /*
     * 最终方法
     * */
    private static void afterAlter(ArrayList<String> originalAllPitch
            , String originalKey
            , int pat
            , String hopingKey) {
        System.out.println("-------------------------------------");
        System.out.println("原谱子为：");
        afterAlterIfEqualOrFinishAlterThenOutput(originalAllPitch, originalKey, pat, hopingKey);
        System.out.println("-------------------------------------");
        System.out.println("固定唱名谱为：");
        ArrayList<String> allAlterToReal = allAlterToReal(originalAllPitch, originalKey);
        realPitch(allAlterToReal, pat);
        System.out.println("-------------------------------------");
        //返回的集合是已经转为C调的集合
        ArrayList<String> afterAlterToCAllPitch = allAlterToC(originalAllPitch, originalKey);
        ArrayList<String> allAlterCToPointKeyAllPitch = allAlterCToPointKey(afterAlterToCAllPitch, hopingKey);
        System.out.printf("转换为%s调后的谱子为：", hopingKey);
        System.out.println();
        afterAlterIfEqualOrFinishAlterThenOutput(allAlterCToPointKeyAllPitch, originalKey, pat, hopingKey);
        System.out.println("-------------------------------------");
        System.out.println("升八度补偿：");
        symbolOverride(raiseOctave(allAlterCToPointKeyAllPitch), pat, hopingKey);
        System.out.println("-------------------------------------");
        System.out.println("降八度补偿：");
        symbolOverride(lowerOctave(allAlterCToPointKeyAllPitch), pat, hopingKey);
    }

    //升降八度补偿：------------------------------------------------
    //raiseOctave() (重写allAlterToC)
    private static ArrayList<String> raiseOctave(ArrayList<String> originalAllPitch) {
        ArrayList<String> afterRaiseOctave = new ArrayList<>();
        try {
            for (String elementKey : originalAllPitch) {
                afterRaiseOctave.add(raiseOnce(elementKey));
            }
        } catch (Exception e) {
            System.out.println("未知错误，请重启");
            System.exit(0);
        }

        return afterRaiseOctave;
    }

    private static String raiseOnce(String elementKey) {

        return switch (elementKey) {
            case "----#1" -> "---#1";
            case "----b2" -> "---b2";
            case "----2" -> "---2";
            case "----#2" -> "---#2";
            case "----b3" -> "---b3";
            case "----3" -> "---3";
            case "----#3" -> "---#3";
            case "----b4" -> "---b4";
            case "----4" -> "---4";
            case "----#4" -> "---#4";
            case "----b5" -> "---b5";
            case "----5" -> "---5";
            case "----#5" -> "---#5";
            case "----b6" -> "---b6";
            case "----6" -> "---6";
            case "----#6" -> "---#6";
            case "----b7" -> "---b7";
            case "----7" -> "---7";
            case "----b1" -> "---b1";

            case "---#1" -> "--#1";
            case "---b2" -> "--b2";
            case "---2" -> "--2";
            case "---#2" -> "--#2";
            case "---b3" -> "--b3";
            case "---3" -> "--3";
            case "---#3" -> "--#3";
            case "---b4" -> "--b4";
            case "---4" -> "--4";
            case "---#4" -> "--#4";
            case "---b5" -> "--b5";
            case "---5" -> "--5";
            case "---#5" -> "--#5";
            case "---b6" -> "--b6";
            case "---6" -> "--6";
            case "---#6" -> "--#6";
            case "---b7" -> "--b7";
            case "---7" -> "--7";
            case "---b1" -> "--b1";

            case "--#1" -> "-#1";
            case "--b2" -> "-b2";
            case "--2" -> "-2";
            case "--#2" -> "-#2";
            case "--b3" -> "-b3";
            case "--3" -> "-3";
            case "--#3" -> "-#3";
            case "--b4" -> "-b4";
            case "--4" -> "-4";
            case "--#4" -> "-#4";
            case "--b5" -> "-b5";
            case "--5" -> "-5";
            case "--#5" -> "-#5";
            case "--b6" -> "-b6";
            case "--6" -> "-6";
            case "--#6" -> "-#6";
            case "--b7" -> "-b7";
            case "--7" -> "-7";
            case "--b1" -> "-b1";
            case "-1" -> "1";
            case "-#1" -> "#1";
            case "-b2" -> "b2";
            case "-2" -> "2";
            case "-#2" -> "#2";
            case "-b3" -> "b3";
            case "-3" -> "3";
            case "-#3" -> "#3";
            case "-b4" -> "b4";
            case "-4" -> "4";
            case "-#4" -> "#4";
            case "-b5" -> "b5";
            case "-5" -> "5";
            case "-#5" -> "#5";
            case "-b6" -> "b6";
            case "-6" -> "6";
            case "-#6" -> "#6";
            case "-b7" -> "b7";
            case "-7" -> "7";
            case "-b1" -> "b1";
            case "1" -> "+1";
            case "#1" -> "+#1";
            case "b2" -> "+b2";
            case "2" -> "+2";
            case "#2" -> "+#2";
            case "b3" -> "+b3";
            case "3" -> "+3";
            case "#3" -> "+#3";
            case "b4" -> "+b4";
            case "4" -> "+4";
            case "#4" -> "+#4";
            case "b5" -> "+b5";
            case "5" -> "+5";
            case "#5" -> "+#5";
            case "b6" -> "+b6";
            case "6" -> "+6";
            case "#6" -> "+#6";
            case "b7" -> "+b7";
            case "7" -> "+7";
            case "+b1" -> "++b1";
            case "+1" -> "++1";
            case "+#1" -> "++#1";
            case "+b2" -> "++b2";
            case "+2" -> "++2";
            case "+#2" -> "++#2";
            case "+b3" -> "++b3";
            case "+3" -> "++3";
            case "+#3" -> "++#3";
            case "+b4" -> "++b4";
            case "+4" -> "++4";
            case "+#4" -> "++#4";
            case "+b5" -> "++b5";
            case "+5" -> "++5";
            case "+#5" -> "++#5";
            case "+b6" -> "++b6";
            case "+6" -> "++6";
            case "+#6" -> "++#6";
            case "+b7" -> "++b7";
            case "+7" -> "++7";
            case "++b1" -> "+++b1";
            case "++1" -> "+++1";
            case "++#1" -> "+++#1";
            case "++b2" -> "+++b2";
            case "++2" -> "+++2";
            case "++#2" -> "+++#2";
            case "++b3" -> "+++b3";
            case "++3" -> "+++3";
            case "++#3" -> "+++#3";
            case "++b4" -> "+++b4";
            case "++4" -> "+++4";
            case "++#4" -> "+++#4";
            case "++b5" -> "+++b5";
            case "++5" -> "+++5";
            case "++#5" -> "+++#5";
            case "++b6" -> "+++b6";
            case "++6" -> "+++6";
            case "++#6" -> "+++#6";
            case "++b7" -> "+++b7";
            case "++7" -> "+++7";
            case "+++b1" -> "++++b1";

            case "+++1" -> "++++1";
            case "+++#1" -> "++++#1";
            case "+++b2" -> "++++b2";
            case "+++2" -> "++++2";
            case "+++#2" -> "++++#2";
            case "+++b3" -> "++++b3";
            case "+++3" -> "++++3";
            case "+++#3" -> "++++#3";
            case "+++b4" -> "++++b4";
            case "+++4" -> "++++4";
            case "+++#4" -> "++++#4";
            case "+++b5" -> "++++b5";
            case "+++5" -> "++++5";
            case "+++#5" -> "++++#5";
            case "+++b6" -> "++++b6";
            case "+++6" -> "++++6";
            case "+++#6" -> "++++#6";
            case "+++b7" -> "++++b7";
            case "+++7" -> "++++7";
            case "++++b1" -> "+++++b1";
            default -> elementKey;
        };
    }

    //lowerOctave() (重写allAlterToC)
    private static ArrayList<String> lowerOctave(ArrayList<String> originalAllPitch) {
        ArrayList<String> afterLowerOctave = new ArrayList<>();
        try {
            for (String elementKey : originalAllPitch) {
                afterLowerOctave.add(lowerOnce(elementKey));
            }
        } catch (Exception e) {
            System.out.println("未知错误，请重启");
            System.exit(0);
        }
        return afterLowerOctave;
    }

    private static String lowerOnce(String elementKey) {
        return switch (elementKey) {
            case "----#1" -> "-----#1";
            case "----b2" -> "-----b2";
            case "----2" -> "-----2";
            case "----#2" -> "-----#2";
            case "----b3" -> "-----b3";
            case "----3" -> "-----3";
            case "----#3" -> "-----#3";
            case "----b4" -> "-----b4";
            case "----4" -> "-----4";
            case "----#4" -> "-----#4";
            case "----b5" -> "-----b5";
            case "----5" -> "-----5";
            case "----#5" -> "-----#5";
            case "----b6" -> "-----b6";
            case "----6" -> "-----6";
            case "----#6" -> "-----#6";
            case "----b7" -> "-----b7";
            case "----7" -> "-----7";
            case "----b1" -> "-----b1";

            case "---#1" -> "----#1";
            case "---b2" -> "----b2";
            case "---2" -> "----2";
            case "---#2" -> "----#2";
            case "---b3" -> "----b3";
            case "---3" -> "----3";
            case "---#3" -> "----#3";
            case "---b4" -> "----b4";
            case "---4" -> "----4";
            case "---#4" -> "----#4";
            case "---b5" -> "----b5";
            case "---5" -> "----5";
            case "---#5" -> "----#5";
            case "---b6" -> "----b6";
            case "---6" -> "----6";
            case "---#6" -> "----#6";
            case "---b7" -> "----b7";
            case "---7" -> "----7";
            case "---b1" -> "----b1";

            case "--1" -> "---1";
            case "--#1" -> "---#1";
            case "--b2" -> "---b2";
            case "--2" -> "---2";
            case "--#2" -> "---#2";
            case "--b3" -> "---b3";
            case "--3" -> "---3";
            case "--#3" -> "---#3";
            case "--b4" -> "---b4";
            case "--4" -> "---4";
            case "--#4" -> "---#4";
            case "--b5" -> "---b5";
            case "--5" -> "---5";
            case "--#5" -> "---#5";
            case "--b6" -> "---b6";
            case "--6" -> "---6";
            case "--#6" -> "---#6";
            case "--b7" -> "---b7";
            case "--7" -> "---7";
            case "--b1" -> "---b1";
            case "-1" -> "--1";
            case "-#1" -> "--#1";
            case "-b2" -> "--b2";
            case "-2" -> "--2";
            case "-#2" -> "--#2";
            case "-b3" -> "--b3";
            case "-3" -> "--3";
            case "-#3" -> "--#3";
            case "-b4" -> "--b4";
            case "-4" -> "--4";
            case "-#4" -> "--#4";
            case "-b5" -> "--b5";
            case "-5" -> "--5";
            case "-#5" -> "--#5";
            case "-b6" -> "--b6";
            case "-6" -> "--6";
            case "-#6" -> "--#6";
            case "-b7" -> "--b7";
            case "-7" -> "--7";
            case "-b1" -> "--b1";
            case "1" -> "-1";
            case "#1" -> "-#1";
            case "b2" -> "-b2";
            case "2" -> "-2";
            case "#2" -> "-#2";
            case "b3" -> "-b3";
            case "3" -> "-3";
            case "#3" -> "-#3";
            case "b4" -> "-b4";
            case "4" -> "-4";
            case "#4" -> "-#4";
            case "b5" -> "-b5";
            case "5" -> "-5";
            case "#5" -> "-#5";
            case "b6" -> "-b6";
            case "6" -> "-6";
            case "#6" -> "-#6";
            case "b7" -> "-b7";
            case "7" -> "-7";
            case "+b1" -> "b1";
            case "+1" -> "1";
            case "+#1" -> "#1";
            case "+b2" -> "b2";
            case "+2" -> "2";
            case "+#2" -> "#2";
            case "+b3" -> "b3";
            case "+3" -> "3";
            case "+#3" -> "++#3";
            case "+b4" -> "b4";
            case "+4" -> "4";
            case "+#4" -> "#4";
            case "+b5" -> "b5";
            case "+5" -> "5";
            case "+#5" -> "#5";
            case "+b6" -> "b6";
            case "+6" -> "6";
            case "+#6" -> "#6";
            case "+b7" -> "b7";
            case "+7" -> "7";
            case "++b1" -> "+b1";
            case "++1" -> "+1";
            case "++#1" -> "+#1";
            case "++b2" -> "+b2";
            case "++2" -> "+2";
            case "++#2" -> "+#2";
            case "++b3" -> "+b3";
            case "++3" -> "+3";
            case "++#3" -> "+#3";
            case "++b4" -> "+b4";
            case "++4" -> "+4";
            case "++#4" -> "+#4";
            case "++b5" -> "+b5";
            case "++5" -> "+5";
            case "++#5" -> "+#5";
            case "++b6" -> "+b6";
            case "++6" -> "+6";
            case "++#6" -> "+#6";
            case "++b7" -> "+b7";
            case "++7" -> "+7";
            case "+++b1" -> "++b1";


            case "+++1" -> "++1";
            case "+++#1" -> "++#1";
            case "+++b2" -> "++b2";
            case "+++2" -> "++2";
            case "+++#2" -> "++#2";
            case "+++b3" -> "++b3";
            case "+++3" -> "++3";
            case "+++#3" -> "++#3";
            case "+++b4" -> "++b4";
            case "+++4" -> "++4";
            case "+++#4" -> "++#4";
            case "+++b5" -> "++b5";
            case "+++5" -> "++5";
            case "+++#5" -> "++#5";
            case "+++b6" -> "++b6";
            case "+++6" -> "++6";
            case "+++#6" -> "++#6";
            case "+++b7" -> "++b7";
            case "+++7" -> "++7";
            case "++++b1" -> "+++b1";
            default -> elementKey;
        };

    }


    //升降八度补偿：------------------------------------------------

    private static final ArrayList<String> CHECK_KEY_LIST = new ArrayList<>();
    private static final ArrayList<String> CHECK_TONE_LIST = new ArrayList<>();

    static {
        CHECK_KEY_LIST.addAll(Arrays.asList("C", "B#", "C#", "Db", "D", "D#", "Eb", "E", "Fb", "F", "E#", "F#", "Gb", "G", "G#", "Ab", "A", "A#", "Bb", "B", "Cb"));
        CHECK_TONE_LIST.addAll(Arrays.asList(
                "--1", "--#1", "--b2", "--2", "--#2", "--b3", "--3", "--b4", "--4", "--#3", "--#4", "--b5", "--5", "--#5", "--b6", "--6", "--#6", "--b7", "--7", "--b1",
                "-1", "-#1", "-b2", "-2", "-#2", "-b3", "-3", "-b4", "-4", "-#3", "-#4", "-b5", "-5", "-#5", "-b6", "-6", "-#6", "-b7", "-7", "-b1",
                "1", "#1", "b2", "2", "#2", "b3", "3", "b4", "4", "#3", "#4", "b5", "5", "#5", "b6", "6", "#6", "b7", "7", "+b1",
                "+1", "+#1", "+b2", "+2", "+#2", "+b3", "+3", "+b4", "+4", "+#3", "+#4", "+b5", "+5", "+#5", "+b6", "+6", "+#6", "+b7", "+7", "++b1",
                "++1", "++#1", "++b2", "++2", "++#2", "++b3", "++3", "++b4", "++4", "++#3", "++#4", "++b5", "++5", "++#5", "++b6", "++6", "++#6", "++b7", "++7", "+++b1"
                , "0"
        ));
    }


    //转成C调的逻辑代码，返回装有转为C调的集合
    private static ArrayList<String> allAlterToC(ArrayList<String> originalAllPitch, String originalKey) {
        ArrayList<String> afterAlterToCAllPitch = new ArrayList<>();
        for (String elementKey : originalAllPitch) {
            if (elementKey.equals("0")) {
                afterAlterToCAllPitch.add("0");
                continue;
            }
            afterAlterToCAllPitch.add(convertToC(elementKey, originalKey));
        }
        return afterAlterToCAllPitch;
    }

    //从C调转成指定调式的逻辑代码，返回装有转为指定调式的集合
    private static ArrayList<String> allAlterCToPointKey(ArrayList<String> afterAlterToCAllPitch, String hopingKey) {
        ArrayList<String> allAlterCToPointKeyAllPitch = new ArrayList<>();
        for (String elementKey : afterAlterToCAllPitch) {
            if (elementKey.equals("0")) {
                allAlterCToPointKeyAllPitch.add("0");
                continue;
            }
            allAlterCToPointKeyAllPitch.add(convertFromC(elementKey, hopingKey));
        }
        return allAlterCToPointKeyAllPitch;
    }

    //-----------------------------------------------------------------
    //转为固定唱名，用于直观看见音符，已完成，在realPitch()中输出(afterAlterIfEqualOrFinishAlterThenOutput重写为realPitch)
    private static ArrayList<String> allAlterToReal(ArrayList<String> originalAllPitch, String originalKey) {
        ArrayList<String> afterAlterToRealAllPitch = new ArrayList<>();
        for (String elementKey : originalAllPitch) {
            if (elementKey.equals("0")) {
                afterAlterToRealAllPitch.add("0");
                continue;
            }
            afterAlterToRealAllPitch.add(convertToReal(elementKey, originalKey));
        }
        return afterAlterToRealAllPitch;
    }

    private static void activate() {
        Scanner input = new Scanner(System.in);
        System.out.println("-------------------------------------------------------------欢迎使用转调器-------------------------------------------------------------");
        System.out.println("使用说明：");
        System.out.println("在使用本转调器时请严格按照指示进行输入（已做异常处理）,使用时请输入合乎简谱规格的音高，+表示升一八度，-表示降一八度。以X大调（1=X,X以你谱子的调式为始调），令b1 = -7，你可以输入的音有：");
        System.out.println("C2-B2：--1，--#1（--b2），--2，--#2（--b3），--3（--b4），--4（--#3），--#4（--b5），--5，--#5（--b6），--6，--#6（--b7），--7（-b1）");
        System.out.println("C3-B3：-1，-#1（-b2），-2，-#2（-b3），-3（-b4），-4（-#3），-#4（-b5），-5，-#5（-b6），-6，-#6（-b7），-7（b1）");
        System.out.println("中央C4-B4：1，#1（b2），2，#2（b3），3（b4），4（#3），#4（b5），5，#5（b6），6，#6（b7），7（+b1）");
        System.out.println("C5-B5：+1，+#1（+b2），+2，+#2（+b3），+3（+b4），+4（+#3），+#4（+b5），+5，+#5（+b6），+6，+#6（+b7），+7（++b1）");
        System.out.println("C6-B6：++1，++#1（++b2），++2，++#2（++b3），++3（++b4），++4（++#3），++#4（++b5），++5，++#5（++b6），++6，++#6（++b7），++7（+++b1）");
        System.out.println("一次请输入一个，从上到下，从左到右，严格遵守规范。");
        System.out.println("注：此简谱转换器旨在帮助转调，方便读谱或调整至乐器相应调性，但对演奏者的视奏与乐理水平的提高帮助不大，望理性使用");
        System.out.println("输入“我已知晓”即可使用，输入“退出”停止运行：");
        String use = input.next();
        if (use.equals("我已知晓")) {
            while (true) {
                System.out.println("输入原调式（C，B#，C#，Db，D，D#，Eb，E，Fb，F，E#，F#，Gb，G，G#，Ab，A，A#，Bb，B，Cb）：");
                String originalKey = input.next();
                if (!CHECK_KEY_LIST.contains(originalKey)) {
                    System.out.println("输入的调号不合规范，请重试！");
                    continue;
                }
                System.out.println("输入小节拍数：");
                int pat;
                try {
                    pat = input.nextInt();
                } catch (Exception e) {
                    System.out.println("请输入数字！");
                    input.next();
                    continue;
                }
                ArrayList<String> originalAllPitch = new ArrayList<>();
                System.out.println("依次输入每个音符(空拍用0代替，输入一个回车后输入下一个)，输入finish退出输入：");
                while (true) {
                    String originalEachPitch = input.next();
                    if (originalEachPitch.equals("finish")) {
                        break;
                    }
                    if (!CHECK_TONE_LIST.contains(originalEachPitch)) {
                        System.out.println("输入了不合规的音高，请接着上个正确输入的音高输入一个正确的");
                        continue;
                    }

                    originalAllPitch.add(originalEachPitch);
                }
                if (originalAllPitch.isEmpty()) {
                    System.out.println("你直接结束了输入，将返回初始位置");
                    continue;
                }
                System.out.println("输入你希望转为的调式（C，B#，C#，Db，D，D#，Eb，E，Fb，F，E#，F#，Gb，G，G#，Ab，A，A#，Bb，B，Cb）：");
                String hopingKey = input.next();
                if (!CHECK_KEY_LIST.contains(hopingKey)) {
                    System.out.println("输入的调号不合规范，请重试！");
                    continue;
                }
                //定义方法用于判断调性是否一致：checkKeyEqual(String originalKey,String hopingKey),true则为一致
                if (checkKeyEqual(originalKey, hopingKey)) {
                    afterAlterIfEqualOrFinishAlterThenOutput(originalAllPitch, originalKey, pat, hopingKey);
                    if (firstCheck == 0) firstCheck = 1;
                    else firstCheck = 0;
                    System.out.println("-------------------------------------");
                    System.out.println("固定唱名谱为：");
                    ArrayList<String> allAlterToReal = allAlterToReal(originalAllPitch, originalKey);
                    realPitch(allAlterToReal, pat);
                } else {
                    afterAlter(originalAllPitch, originalKey, pat, hopingKey);
                }
                System.out.println("转换完毕，输入任意数字继续，输入0退出：");
                String continueTo = input.next();
                try {
                    if (Integer.parseInt(continueTo) == 0) {
                        System.out.println("感谢使用，再会！");
                        break;
                    }
                } catch (Exception e) {
                    System.out.println("输入非数字或数字过大，将关闭程序！");
                    System.exit(0);
                }
            }
        } else if (use.equals("退出")) {
            System.exit(0);
        } else {
            System.out.println("请重启");
            System.exit(0);
        }
    }

    private static String convertToReal(String note, String originalKey) {
        return switch (originalKey) {
            case C_KEY, UP_B_KEY -> note;
            case UP_C_KEY, DOWN_D_KEY -> cSharpToReal(note);
            case D_KEY -> dToReal(note);
            case UP_D_KEY, DOWN_E_KEY -> dSharpToReal(note);
            case E_KEY, DOWN_F_KEY -> eToReal(note);
            case F_KEY, UP_E_KEY -> fToReal(note);
            case UP_F_KEY, DOWN_G_KEY -> fSharpToReal(note);
            case G_KEY -> gToReal(note);
            case UP_G_KEY, DOWN_A_KEY -> gSharpToReal(note);
            case A_KEY -> aToReal(note);
            case UP_A_KEY, DOWN_B_KEY -> aSharpToReal(note);
            case B_KEY, DOWN_C_KEY -> bToReal(note);
            default -> note;
        };
    }

    private static String cSharpToReal(String note) {

        return switch (note) {
            case "--1" -> "--#1";
            case "--#1", "--b2" -> "--2";
            case "--2" -> "--#2";
            case "--#2" -> "--3";
            case "--b3" -> "--3";
            case "--3" -> "--4";
            case "--b4" -> "--4";
            case "--#3" -> "--#4";
            case "--4" -> "--#4";
            case "--#4" -> "--5";
            case "--b5" -> "--5";
            case "--5" -> "--#5";
            case "--#5" -> "--6";
            case "--b6" -> "--6";
            case "--6" -> "--#6";
            case "--#6" -> "--7";
            case "--b7" -> "--7";
            case "--7" -> "-1";
            case "--b1" -> "-1";
            case "-1" -> "-#1";
            case "-#1" -> "-2";
            case "-b2" -> "-2";
            case "-2" -> "-#2";
            case "-#2" -> "-3";
            case "-b3" -> "-3";
            case "-3" -> "-4";
            case "-#3" -> "-#4";
            case "-b4" -> "-4";
            case "-4" -> "-#4";
            case "-#4" -> "-5";
            case "-b5" -> "-5";
            case "-5" -> "-#5";
            case "-#5" -> "-6";
            case "-b6" -> "-6";
            case "-6" -> "-#6";
            case "-#6" -> "-7";
            case "-b7" -> "-7";
            case "-7" -> "1";
            case "-b1" -> "1";
            case "1" -> "#1";
            case "#1" -> "2";
            case "b2" -> "2";
            case "2" -> "#2";
            case "#2" -> "3";
            case "b3" -> "3";
            case "3" -> "4";
            case "b4" -> "4";
            case "4" -> "#4";
            case "#3" -> "#4";
            case "#4" -> "5";
            case "b5" -> "5";
            case "5" -> "#5";
            case "#5" -> "6";
            case "b6" -> "6";
            case "6" -> "#6";
            case "#6" -> "7";
            case "b7" -> "7";
            case "7" -> "+1";
            case "+b1" -> "+1";
            case "+1" -> "+#1";
            case "+#1" -> "+2";
            case "+b2" -> "+2";
            case "+2" -> "+#2";
            case "+#2" -> "+3";
            case "+b3" -> "+3";
            case "+3" -> "+4";
            case "+b4" -> "+4";
            case "+4" -> "+#4";
            case "+#3" -> "+#4";
            case "+#4" -> "+5";
            case "+b5" -> "+5";
            case "+5" -> "+#5";
            case "+#5" -> "+6";
            case "+b6" -> "+6";
            case "+6" -> "+#6";
            case "+#6" -> "+7";
            case "+b7" -> "+7";
            case "+7" -> "++1";
            case "++b1" -> "++1";
            case "++1" -> "++#1";
            case "++#1" -> "++2";
            case "++b2" -> "++2";
            case "++2" -> "++#2";
            case "++#2" -> "++3";
            case "++b3" -> "++3";
            case "++3" -> "++4";
            case "++b4" -> "++4";
            case "++4" -> "++#4";
            case "++#3" -> "++#4";
            case "++#4" -> "++5";
            case "++b5" -> "++5";
            case "++5" -> "++#5";
            case "++#5" -> "++6";
            case "++b6" -> "++6";
            case "++6" -> "++#6";
            case "++#6" -> "++7";
            case "++b7" -> "++7";
            case "++7" -> "+++1";
            case "+++b1" -> "+++1";
            default -> note;
        };
    }


    private static String dToReal(String note) {
        return switch (note) {
            case "--1" -> "--2";
            case "--#1", "--b2" -> "--#2";
            case "--2" -> "--3";
            case "--#2" -> "--4";
            case "--b3" -> "--4";
            case "--3" -> "--#4";
            case "--b4" -> "--#4";
            case "--4" -> "--5";
            case "--#3" -> "--5";
            case "--#4" -> "--#5";
            case "--b5" -> "--#5";
            case "--5" -> "--6";
            case "--#5" -> "--#6";
            case "--b6" -> "--#6";
            case "--6" -> "--7";
            case "--#6" -> "-1";
            case "--b7" -> "-1";
            case "--7" -> "-#1";
            case "--b1" -> "-#1";
            case "-1" -> "-2";
            case "-#1" -> "-#2";
            case "-b2" -> "-#2";
            case "-2" -> "-3";
            case "-#2" -> "-4";
            case "-b3" -> "-4";
            case "-3" -> "-#4";
            case "-b4" -> "-#4";
            case "-4" -> "-5";
            case "-#3" -> "-5";
            case "-#4" -> "-#5";
            case "-b5" -> "-#5";
            case "-5" -> "-6";
            case "-#5" -> "-#6";
            case "-b6" -> "-#6";
            case "-6" -> "-7";
            case "-#6" -> "1";
            case "-b7" -> "1";
            case "-7" -> "#1";
            case "-b1" -> "#1";
            case "1" -> "2";
            case "#1" -> "#2";
            case "b2" -> "#2";
            case "2" -> "3";
            case "#2" -> "4";
            case "b3" -> "4";
            case "3" -> "#4";
            case "b4" -> "#4";
            case "4" -> "5";
            case "#3" -> "5";
            case "#4" -> "#5";
            case "b5" -> "#5";
            case "5" -> "6";
            case "#5" -> "#6";
            case "b6" -> "#6";
            case "6" -> "7";
            case "#6" -> "+1";
            case "b7" -> "+1";
            case "7" -> "+#1";
            case "+b1" -> "+#1";
            case "+1" -> "+2";
            case "+#1" -> "+#2";
            case "+b2" -> "+#2";
            case "+2" -> "+3";
            case "+#2" -> "+4";
            case "+b3" -> "+4";
            case "+3" -> "+#4";
            case "+b4" -> "+#4";
            case "+4" -> "+5";
            case "+#3" -> "+5";
            case "+#4" -> "+#5";
            case "+b5" -> "+#5";
            case "+5" -> "+6";
            case "+#5" -> "+#6";
            case "+b6" -> "+#6";
            case "+6" -> "+7";
            case "+#6" -> "++1";
            case "+b7" -> "++1";
            case "+7" -> "++#1";
            case "++b1" -> "++#1";
            case "++1" -> "++2";
            case "++#1" -> "++#2";
            case "++b2" -> "++#2";
            case "++2" -> "++3";
            case "++#2" -> "++4";
            case "++b3" -> "++4";
            case "++3" -> "++#4";
            case "++b4" -> "++#4";
            case "++4" -> "++5";
            case "++#3" -> "++5";
            case "++#4" -> "++#5";
            case "++b5" -> "++#5";
            case "++5" -> "++6";
            case "++#5" -> "++#6";
            case "++b6" -> "++#6";
            case "++6" -> "++7";
            case "++#6" -> "+++1";
            case "++b7" -> "+++1";
            case "++7" -> "+++#1";
            case "+++b1" -> "+++#1";
            default -> note;
        };
    }


    private static String dSharpToReal(String note) {
        return switch (note) {
            case "--1" -> "--#2";
            case "--#1", "--b2" -> "--3";
            case "--2" -> "--4";
            case "--#2" -> "--#4";
            case "--b3" -> "--#4";
            case "--3" -> "--5";
            case "--b4" -> "--5";
            case "--4" -> "--#5";
            case "--#3" -> "--#5";
            case "--#4" -> "--6";
            case "--b5" -> "--6";
            case "--5" -> "--#6";
            case "--#5" -> "--7";
            case "--b6" -> "--7";
            case "--6" -> "-1";
            case "--#6" -> "-#1";
            case "--b7" -> "-#1";
            case "--7" -> "-2";
            case "--b1" -> "-2";
            case "-1" -> "-#2";
            case "-#1" -> "-3";
            case "-b2" -> "-3";
            case "-2" -> "-4";
            case "-#2" -> "-#4";
            case "-b3" -> "-#4";
            case "-3" -> "-5";
            case "-b4" -> "-5";
            case "-4" -> "-#5";
            case "-#3" -> "-#5";
            case "-#4" -> "-6";
            case "-b5" -> "-6";
            case "-5" -> "-#6";
            case "-#5" -> "-7";
            case "-b6" -> "-7";
            case "-6" -> "1";
            case "-#6" -> "#1";
            case "-b7" -> "#1";
            case "-7" -> "2";
            case "-b1" -> "2";
            case "1" -> "#2";
            case "#1" -> "3";
            case "b2" -> "3";
            case "2" -> "4";
            case "#2" -> "#4";
            case "b3" -> "#4";
            case "3" -> "5";
            case "b4" -> "5";
            case "4" -> "#5";
            case "#3" -> "#5";
            case "#4" -> "6";
            case "b5" -> "6";
            case "5" -> "#6";
            case "#5" -> "7";
            case "b6" -> "7";
            case "6" -> "+1";
            case "#6" -> "+#1";
            case "b7" -> "+#1";
            case "7" -> "+2";
            case "+b1" -> "+2";
            case "+1" -> "+#2";
            case "+#1" -> "+3";
            case "+b2" -> "+3";
            case "+2" -> "+4";
            case "+#2" -> "+#4";
            case "+b3" -> "+#4";
            case "+3" -> "+5";
            case "+b4" -> "+5";
            case "+4" -> "+#5";
            case "+#3" -> "+#5";
            case "+#4" -> "+6";
            case "+b5" -> "+6";
            case "+5" -> "+#6";
            case "+#5" -> "+7";
            case "+b6" -> "+7";
            case "+6" -> "++1";
            case "+#6" -> "++#1";
            case "+b7" -> "++#1";
            case "+7" -> "++2";
            case "++b1" -> "++2";
            case "++1" -> "++#2";
            case "++#1" -> "++3";
            case "++b2" -> "++3";
            case "++2" -> "++4";
            case "++#2" -> "++#4";
            case "++b3" -> "++#4";
            case "++3" -> "++5";
            case "++b4" -> "++5";
            case "++4" -> "++#5";
            case "++#3" -> "++#5";
            case "++#4" -> "++6";
            case "++b5" -> "++6";
            case "++5" -> "++#6";
            case "++#5" -> "++7";
            case "++b6" -> "++7";
            case "++6" -> "+++1";
            case "++#6" -> "+++#1";
            case "++b7" -> "+++#1";
            case "++7" -> "+++2";
            case "+++b1" -> "+++2";
            default -> note;
        };
    }


    private static String eToReal(String note) {
        return switch (note) {
            case "--1" -> "--3";
            case "--#1", "--b2" -> "--4";
            case "--2" -> "--#4";
            case "--#2" -> "--5";
            case "--b3" -> "--5";
            case "--3" -> "--#5";
            case "--b4" -> "--#5";
            case "--4" -> "--6";
            case "--#3" -> "--6";
            case "--#4" -> "--#6";
            case "--b5" -> "--#6";
            case "--5" -> "--7";
            case "--#5" -> "-1";
            case "--b6" -> "-1";
            case "--6" -> "-#1";
            case "--#6" -> "-2";
            case "--b7" -> "-2";
            case "--7" -> "-#2";
            case "--b1" -> "-#2";
            case "-1" -> "-3";
            case "-#1" -> "-4";
            case "-b2" -> "-4";
            case "-2" -> "-#4";
            case "-#2" -> "-5";
            case "-b3" -> "-5";
            case "-3" -> "-#5";
            case "-b4" -> "-#5";
            case "-4" -> "-6";
            case "-#3" -> "-6";
            case "-#4" -> "-#6";
            case "-b5" -> "-#6";
            case "-5" -> "-7";
            case "-#5" -> "1";
            case "-b6" -> "1";
            case "-6" -> "#1";
            case "-#6" -> "2";
            case "-b7" -> "2";
            case "-7" -> "#2";
            case "-b1" -> "#2";
            case "1" -> "3";
            case "#1" -> "4";
            case "b2" -> "4";
            case "2" -> "#4";
            case "#2" -> "5";
            case "b3" -> "5";
            case "3" -> "#5";
            case "b4" -> "#5";
            case "4" -> "6";
            case "#3" -> "6";
            case "#4" -> "#6";
            case "b5" -> "#6";
            case "5" -> "7";
            case "#5" -> "+1";
            case "b6" -> "+1";
            case "6" -> "+#1";
            case "#6" -> "+2";
            case "b7" -> "+2";
            case "7" -> "+#2";
            case "+b1" -> "+#2";
            case "+1" -> "+3";
            case "+#1" -> "+4";
            case "+b2" -> "+4";
            case "+2" -> "+#4";
            case "+#2" -> "+5";
            case "+b3" -> "+5";
            case "+3" -> "+#5";
            case "+b4" -> "+#5";
            case "+4" -> "+6";
            case "+#3" -> "+6";
            case "+#4" -> "+#6";
            case "+b5" -> "+#6";
            case "+5" -> "+7";
            case "+#5" -> "++1";
            case "+b6" -> "++1";
            case "+6" -> "++#1";
            case "+#6" -> "++2";
            case "+b7" -> "++2";
            case "+7" -> "++#2";
            case "++b1" -> "++#2";
            case "++1" -> "++3";
            case "++#1" -> "++4";
            case "++b2" -> "++4";
            case "++2" -> "++#4";
            case "++#2" -> "++5";
            case "++b3" -> "++5";
            case "++3" -> "++#5";
            case "++b4" -> "++#5";
            case "++4" -> "++6";
            case "++#3" -> "++6";
            case "++#4" -> "++#6";
            case "++b5" -> "++#6";
            case "++5" -> "++7";
            case "++#5" -> "+++1";
            case "++b6" -> "+++1";
            case "++6" -> "+++#1";
            case "++#6" -> "+++2";
            case "++b7" -> "+++2";
            case "++7" -> "+++#2";
            case "+++b1" -> "+++#2";
            default -> note;
        };
    }


    private static String fToReal(String note) {
        return switch (note) {
            case "--1" -> "--4";
            case "--#1", "--b2" -> "--#4";
            case "--2" -> "--5";
            case "--#2" -> "--#5";
            case "--b3" -> "--#5";
            case "--3" -> "--6";
            case "--b4" -> "--6";
            case "--4" -> "--#6";
            case "--#3" -> "--#6";
            case "--#4" -> "--7";
            case "--b5" -> "--7";
            case "--5" -> "-1";
            case "--#5" -> "-#1";
            case "--b6" -> "-#1";
            case "--6" -> "-2";
            case "--#6" -> "-#2";
            case "--b7" -> "-#2";
            case "--7" -> "-3";
            case "--b1" -> "-3";
            case "-1" -> "-4";
            case "-#1" -> "-#4";
            case "-b2" -> "-#4";
            case "-2" -> "-5";
            case "-#2" -> "-#5";
            case "-b3" -> "-#5";
            case "-3" -> "-6";
            case "-b4" -> "-6";
            case "-4" -> "-#6";
            case "-#3" -> "-#6";
            case "-#4" -> "-7";
            case "-b5" -> "-7";
            case "-5" -> "1";
            case "-#5" -> "#1";
            case "-b6" -> "#1";
            case "-6" -> "2";
            case "-#6" -> "#2";
            case "-b7" -> "#2";
            case "-7" -> "3";
            case "-b1" -> "3";
            case "1" -> "4";
            case "#1" -> "#4";
            case "b2" -> "#4";
            case "2" -> "5";
            case "#2" -> "#5";
            case "b3" -> "#5";
            case "3" -> "6";
            case "b4" -> "6";
            case "4" -> "#6";
            case "#3" -> "#6";
            case "#4" -> "7";
            case "b5" -> "7";
            case "5" -> "+1";
            case "#5" -> "+#1";
            case "b6" -> "+#1";
            case "6" -> "+2";
            case "#6" -> "+#2";
            case "b7" -> "+#2";
            case "7" -> "+3";
            case "+b1" -> "+3";
            case "+1" -> "+4";
            case "+#1" -> "+#4";
            case "+b2" -> "+#4";
            case "+2" -> "+5";
            case "+#2" -> "+#5";
            case "+b3" -> "+#5";
            case "+3" -> "+6";
            case "+b4" -> "+6";
            case "+4" -> "+#6";
            case "+#3" -> "+#6";
            case "+#4" -> "+7";
            case "+b5" -> "+7";
            case "+5" -> "++1";
            case "+#5" -> "++#1";
            case "+b6" -> "++#1";
            case "+6" -> "++2";
            case "+#6" -> "++#2";
            case "+b7" -> "++#2";
            case "+7" -> "++3";
            case "++b1" -> "++3";
            case "++1" -> "++4";
            case "++#1" -> "++#4";
            case "++b2" -> "++#4";
            case "++2" -> "++5";
            case "++#2" -> "++#5";
            case "++b3" -> "++#5";
            case "++3" -> "++6";
            case "++b4" -> "++6";
            case "++4" -> "++#6";
            case "++#3" -> "++#6";
            case "++#4" -> "++7";
            case "++b5" -> "++7";
            case "++5" -> "+++1";
            case "++#5" -> "+++#1";
            case "++b6" -> "+++#1";
            case "++6" -> "+++2";
            case "++#6" -> "+++#2";
            case "++b7" -> "+++#2";
            case "++7" -> "+++3";
            case "+++b1" -> "+++3";
            default -> note;
        };
    }


    private static String fSharpToReal(String note) {
        return switch (note) {
            case "--1" -> "--#4";
            case "--#1", "--b2" -> "--5";
            case "--2" -> "--#5";
            case "--#2" -> "--6";
            case "--b3" -> "--6";
            case "--3" -> "--#6";
            case "--b4" -> "--#6";
            case "--4" -> "--7";
            case "--#3" -> "--7";
            case "--#4" -> "-1";
            case "--b5" -> "-1";
            case "--5" -> "-#1";
            case "--#5" -> "-2";
            case "--b6" -> "-2";
            case "--6" -> "-#2";
            case "--#6" -> "-3";
            case "--b7" -> "-3";
            case "--7" -> "-4";
            case "--b1" -> "-4";
            case "-1" -> "-#4";
            case "-#1" -> "-5";
            case "-b2" -> "-5";
            case "-2" -> "-#5";
            case "-#2" -> "-6";
            case "-b3" -> "-6";
            case "-3" -> "-#6";
            case "-b4" -> "-#6";
            case "-4" -> "-7";
            case "-#3" -> "-7";
            case "-#4" -> "1";
            case "-b5" -> "1";
            case "-5" -> "#1";
            case "-#5" -> "2";
            case "-b6" -> "2";
            case "-6" -> "#2";
            case "-#6" -> "3";
            case "-b7" -> "3";
            case "-7" -> "4";
            case "-b1" -> "4";
            case "1" -> "#4";
            case "#1" -> "5";
            case "b2" -> "5";
            case "2" -> "#5";
            case "#2" -> "6";
            case "b3" -> "6";
            case "3" -> "#6";
            case "b4" -> "#6";
            case "4" -> "7";
            case "#3" -> "7";
            case "#4" -> "+1";
            case "b5" -> "+1";
            case "5" -> "+#1";
            case "#5" -> "+2";
            case "b6" -> "+2";
            case "6" -> "+#2";
            case "#6" -> "+3";
            case "b7" -> "+3";
            case "7" -> "+4";
            case "+b1" -> "+4";
            case "+1" -> "+#4";
            case "+#1" -> "+5";
            case "+b2" -> "+5";
            case "+2" -> "+#5";
            case "+#2" -> "+6";
            case "+b3" -> "+6";
            case "+3" -> "+#6";
            case "+b4" -> "+#6";
            case "+4" -> "+7";
            case "+#3" -> "+7";
            case "+#4" -> "++1";
            case "+b5" -> "++1";
            case "+5" -> "++#1";
            case "+#5" -> "++2";
            case "+b6" -> "++2";
            case "+6" -> "++#2";
            case "+#6" -> "++3";
            case "+b7" -> "++3";
            case "+7" -> "++4";
            case "++b1" -> "++4";
            case "++1" -> "++#4";
            case "++#1" -> "++5";
            case "++b2" -> "++5";
            case "++2" -> "++#5";
            case "++#2" -> "++6";
            case "++b3" -> "++6";
            case "++3" -> "++#6";
            case "++b4" -> "++#6";
            case "++4" -> "++7";
            case "++#3" -> "++7";
            case "++#4" -> "+++1";
            case "++b5" -> "+++1";
            case "++5" -> "+++#1";
            case "++#5" -> "+++2";
            case "++b6" -> "+++3";
            case "++6" -> "+++#2";
            case "++#6" -> "+++3";
            case "++b7" -> "+++3";
            case "++7" -> "+++4";
            case "+++b1" -> "+++4";
            default -> note;
        };
    }


    private static String gToReal(String note) {
        return switch (note) {
            case "--1" -> "--5";
            case "--#1", "--b2" -> "--#5";
            case "--2" -> "--6";
            case "--#2" -> "--#6";
            case "--b3" -> "--#6";
            case "--3" -> "--7";
            case "--b4" -> "--7";
            case "--4" -> "-1";
            case "--#3" -> "-1";
            case "--#4" -> "-#1";
            case "--b5" -> "-#1";
            case "--5" -> "-2";
            case "--#5" -> "-#2";
            case "--b6" -> "-#2";
            case "--6" -> "-3";
            case "--#6" -> "-4";
            case "--b7" -> "-4";
            case "--7" -> "-#4";
            case "--b1" -> "-#4";
            case "-1" -> "-5";
            case "-#1" -> "-#5";
            case "-b2" -> "-#5";
            case "-2" -> "-6";
            case "-#2" -> "-#6";
            case "-b3" -> "-#6";
            case "-3" -> "-7";
            case "-b4" -> "-7";
            case "-4" -> "1";
            case "-#3" -> "1";
            case "-#4" -> "#1";
            case "-b5" -> "#1";
            case "-5" -> "2";
            case "-#5" -> "#2";
            case "-b6" -> "#2";
            case "-6" -> "3";
            case "-#6" -> "4";
            case "-b7" -> "4";
            case "-7" -> "#4";
            case "-b1" -> "#4";
            case "1" -> "5";
            case "#1" -> "#5";
            case "b2" -> "#5";
            case "2" -> "6";
            case "#2" -> "#6";
            case "b3" -> "#6";
            case "3" -> "7";
            case "b4" -> "7";
            case "4" -> "+1";
            case "#3" -> "+1";
            case "#4" -> "+#1";
            case "b5" -> "+#1";
            case "5" -> "+2";
            case "#5" -> "+#2";
            case "b6" -> "+#2";
            case "6" -> "+3";
            case "#6" -> "+4";
            case "b7" -> "+4";
            case "7" -> "+#4";
            case "+b1" -> "+#4";
            case "+1" -> "+5";
            case "+#1" -> "+#5";
            case "+b2" -> "+#5";
            case "+2" -> "+6";
            case "+#2" -> "+#6";
            case "+b3" -> "+#6";
            case "+3" -> "+7";
            case "+b4" -> "+7";
            case "+4" -> "++1";
            case "+#3" -> "++1";
            case "+#4" -> "++#1";
            case "+b5" -> "++#1";
            case "+5" -> "++2";
            case "+#5" -> "++#2";
            case "+b6" -> "++#2";
            case "+6" -> "++3";
            case "+#6" -> "++4";
            case "+b7" -> "++4";
            case "+7" -> "++#4";
            case "++b1" -> "++#4";
            case "++1" -> "++5";
            case "++#1" -> "++#5";
            case "++b2" -> "++#5";
            case "++2" -> "++6";
            case "++#2" -> "++#6";
            case "++b3" -> "++#6";
            case "++3" -> "++7";
            case "++b4" -> "++7";
            case "++4" -> "+++1";
            case "++#3" -> "+++1";
            case "++#4" -> "+++#1";
            case "++b5" -> "+++#1";
            case "++5" -> "+++2";
            case "++#5" -> "+++#2";
            case "++b6" -> "+++4";
            case "++6" -> "+++3";
            case "++#6" -> "+++4";
            case "++b7" -> "+++4";
            case "++7" -> "+++#4";
            case "+++b1" -> "+++#4";
            default -> note;
        };
    }


    private static String gSharpToReal(String note) {
        return switch (note) {
            case "--1" -> "--#5";
            case "--#1", "--b2" -> "--6";
            case "--2" -> "--#6";
            case "--#2" -> "--7";
            case "--b3" -> "--7";
            case "--3" -> "-1";
            case "--b4" -> "-1";
            case "--4" -> "-#1";
            case "--#3" -> "-#1";
            case "--#4" -> "-2";
            case "--b5" -> "-2";
            case "--5" -> "-#2";
            case "--#5" -> "-3";
            case "--b6" -> "-3";
            case "--6" -> "-4";
            case "--#6" -> "-#4";
            case "--b7" -> "-#4";
            case "--7" -> "-5";
            case "--b1" -> "-5";
            case "-1" -> "-#5";
            case "-#1" -> "-6";
            case "-b2" -> "-6";
            case "-2" -> "-#6";
            case "-#2" -> "-7";
            case "-b3" -> "-7";
            case "-3" -> "1";
            case "-b4" -> "1";
            case "-4" -> "#1";
            case "-#3" -> "#1";
            case "-#4" -> "2";
            case "-b5" -> "2";
            case "-5" -> "#2";
            case "-#5" -> "3";
            case "-b6" -> "3";
            case "-6" -> "4";
            case "-#6" -> "#4";
            case "-b7" -> "#4";
            case "-7" -> "5";
            case "-b1" -> "5";
            case "1" -> "#5";
            case "#1" -> "6";
            case "b2" -> "6";
            case "2" -> "#6";
            case "#2" -> "7";
            case "b3" -> "7";
            case "3" -> "+1";
            case "b4" -> "+1";
            case "4" -> "+#1";
            case "#3" -> "+#1";
            case "#4" -> "+2";
            case "b5" -> "+2";
            case "5" -> "+#2";
            case "#5" -> "+3";
            case "b6" -> "+3";
            case "6" -> "+4";
            case "#6" -> "+#4";
            case "b7" -> "+#4";
            case "7" -> "+5";
            case "+b1" -> "+5";
            case "+1" -> "+#5";
            case "+#1" -> "+6";
            case "+b2" -> "+6";
            case "+2" -> "+#6";
            case "+#2" -> "+7";
            case "+b3" -> "+7";
            case "+3" -> "++1";
            case "+b4" -> "++1";
            case "+4" -> "++#1";
            case "+#3" -> "++#1";
            case "+#4" -> "++2";
            case "+b5" -> "++2";
            case "+5" -> "++#2";
            case "+#5" -> "++3";
            case "+b6" -> "++3";
            case "+6" -> "++4";
            case "+#6" -> "++#4";
            case "+b7" -> "++#4";
            case "+7" -> "++5";
            case "++b1" -> "++5";
            case "++1" -> "++#5";
            case "++#1" -> "++6";
            case "++b2" -> "++6";
            case "++2" -> "++#6";
            case "++#2" -> "++7";
            case "++b3" -> "++7";
            case "++3" -> "+++1";
            case "++b4" -> "+++1";
            case "++4" -> "+++#1";
            case "++#3" -> "+++#1";
            case "++#4" -> "+++2";
            case "++b5" -> "+++2";
            case "++5" -> "+++#2";
            case "++#5" -> "+++3";
            case "++b6" -> "+++#4";
            case "++6" -> "+++4";
            case "++#6" -> "+++#4";
            case "++b7" -> "+++#4";
            case "++7" -> "+++5";
            case "+++b1" -> "+++5";
            default -> note;
        };
    }


    private static String aToReal(String note) {
        return switch (note) {
            case "--1" -> "--6";
            case "--#1", "--b2" -> "--#6";
            case "--2" -> "--7";
            case "--#2" -> "-1";
            case "--b3" -> "-1";
            case "--3" -> "-#1";
            case "--b4" -> "-#1";
            case "--4" -> "-2";
            case "--#3" -> "-2";
            case "--#4" -> "-#2";
            case "--b5" -> "-#2";
            case "--5" -> "-3";
            case "--#5" -> "-4";
            case "--b6" -> "-4";
            case "--6" -> "-#4";
            case "--#6" -> "-5";
            case "--b7" -> "-5";
            case "--7" -> "-#5";
            case "--b1" -> "-#5";
            case "-1" -> "-6";
            case "-#1" -> "-#6";
            case "-b2" -> "-#6";
            case "-2" -> "-7";
            case "-#2" -> "1";
            case "-b3" -> "1";
            case "-3" -> "#1";
            case "-b4" -> "#1";
            case "-4" -> "2";
            case "-#3" -> "2";
            case "-#4" -> "#2";
            case "-b5" -> "#2";
            case "-5" -> "3";
            case "-#5" -> "4";
            case "-b6" -> "4";
            case "-6" -> "#4";
            case "-#6" -> "5";
            case "-b7" -> "5";
            case "-7" -> "#5";
            case "-b1" -> "#5";
            case "1" -> "6";
            case "#1" -> "#6";
            case "b2" -> "#6";
            case "2" -> "7";
            case "#2" -> "+1";
            case "b3" -> "+1";
            case "3" -> "+#1";
            case "b4" -> "+#1";
            case "4" -> "+2";
            case "#3" -> "+2";
            case "#4" -> "+#2";
            case "b5" -> "+#2";
            case "5" -> "+3";
            case "#5" -> "+4";
            case "b6" -> "+4";
            case "6" -> "+#4";
            case "#6" -> "+5";
            case "b7" -> "+5";
            case "7" -> "+#5";
            case "+b1" -> "+#5";
            case "+1" -> "+6";
            case "+#1" -> "+#6";
            case "+b2" -> "+#6";
            case "+2" -> "+7";
            case "+#2" -> "++1";
            case "+b3" -> "++1";
            case "+3" -> "++#1";
            case "+b4" -> "++#1";
            case "+4" -> "++2";
            case "+#3" -> "++2";
            case "+#4" -> "++#2";
            case "+b5" -> "++#2";
            case "+5" -> "++3";
            case "+#5" -> "++4";
            case "+b6" -> "++4";
            case "+6" -> "++#4";
            case "+#6" -> "++5";
            case "+b7" -> "++5";
            case "+7" -> "++#5";
            case "++b1" -> "++#5";
            case "++1" -> "++6";
            case "++#1" -> "++#6";
            case "++b2" -> "++#6";
            case "++2" -> "++7";
            case "++#2" -> "+++1";
            case "++b3" -> "+++1";
            case "++3" -> "+++#1";
            case "++b4" -> "+++#1";
            case "++4" -> "+++2";
            case "++#3" -> "+++2";
            case "++#4" -> "+++#2";
            case "++b5" -> "+++#2";
            case "++5" -> "+++3";
            case "++#5" -> "+++4";
            case "++b6" -> "+++5";
            case "++6" -> "+++#4";
            case "++#6" -> "+++5";
            case "++b7" -> "+++5";
            case "++7" -> "+++#5";
            case "+++b1" -> "+++#5";
            default -> note;
        };
    }


    private static String aSharpToReal(String note) {
        return switch (note) {
            case "--1" -> "--#6";
            case "--#1", "--b2" -> "--7";
            case "--2" -> "-1";
            case "--#2" -> "-#1";
            case "--b3" -> "-#1";
            case "--3" -> "-2";
            case "--b4" -> "-2";
            case "--4" -> "-#2";
            case "--#3" -> "-#2";
            case "--#4" -> "-3";
            case "--b5" -> "-3";
            case "--5" -> "-4";
            case "--#5" -> "-#4";
            case "--b6" -> "-#4";
            case "--6" -> "-5";
            case "--#6" -> "-#5";
            case "--b7" -> "-#5";
            case "--7" -> "-6";
            case "--b1" -> "-6";
            case "-1" -> "-#6";
            case "-#1" -> "-7";
            case "-b2" -> "-7";
            case "-2" -> "1";
            case "-#2" -> "#1";
            case "-b3" -> "#1";
            case "-3" -> "2";
            case "-b4" -> "2";
            case "-4" -> "#2";
            case "-#3" -> "#2";
            case "-#4" -> "3";
            case "-b5" -> "3";
            case "-5" -> "4";
            case "-#5" -> "#4";
            case "-b6" -> "#4";
            case "-6" -> "5";
            case "-#6" -> "#5";
            case "-b7" -> "#5";
            case "-7" -> "6";
            case "-b1" -> "6";
            case "1" -> "#6";
            case "#1" -> "7";
            case "b2" -> "7";
            case "2" -> "+1";
            case "#2" -> "+#1";
            case "b3" -> "+#1";
            case "3" -> "+2";
            case "b4" -> "+2";
            case "4" -> "+#2";
            case "#3" -> "+#2";
            case "#4" -> "+3";
            case "b5" -> "+3";
            case "5" -> "+4";
            case "#5" -> "+#4";
            case "b6" -> "+#4";
            case "6" -> "+5";
            case "#6" -> "+#5";
            case "b7" -> "+#5";
            case "7" -> "+6";
            case "+b1" -> "+6";
            case "+1" -> "+#6";
            case "+#1" -> "+7";
            case "+b2" -> "+7";
            case "+2" -> "++1";
            case "+#2" -> "++#1";
            case "+b3" -> "++#1";
            case "+3" -> "++2";
            case "+b4" -> "++2";
            case "+4" -> "++#2";
            case "+#3" -> "++#2";
            case "+#4" -> "++3";
            case "+b5" -> "++3";
            case "+5" -> "++4";
            case "+#5" -> "++#4";
            case "+b6" -> "++#4";
            case "+6" -> "++5";
            case "+#6" -> "++#5";
            case "+b7" -> "++#5";
            case "+7" -> "++6";
            case "++b1" -> "++6";
            case "++1" -> "++#6";
            case "++#1" -> "++7";
            case "++b2" -> "++7";
            case "++2" -> "+++1";
            case "++#2" -> "+++#1";
            case "++b3" -> "+++#1";
            case "++3" -> "+++2";
            case "++b4" -> "+++2";
            case "++4" -> "+++#2";
            case "++#3" -> "+++#2";
            case "++#4" -> "+++3";
            case "++b5" -> "+++3";
            case "++5" -> "+++4";
            case "++#5" -> "+++#4";
            case "++b6" -> "+++#4";
            case "++6" -> "+++5";
            case "++#6" -> "+++#5";
            case "++b7" -> "+++#5";
            case "++7" -> "+++6";
            case "+++b1" -> "+++6";
            default -> note;
        };
    }


    private static String bToReal(String note) {
        return switch (note) {
            case "--1" -> "--7";
            case "--#1", "--b2" -> "-1";
            case "--2" -> "-#1";
            case "--#2" -> "-2";
            case "--b3" -> "-2";
            case "--3" -> "-#2";
            case "--b4" -> "-#2";
            case "--4" -> "-3";
            case "--#3" -> "-3";
            case "--#4" -> "-4";
            case "--b5" -> "-4";
            case "--5" -> "-#4";
            case "--#5" -> "-5";
            case "--b6" -> "-5";
            case "--6" -> "-#5";
            case "--#6" -> "-6";
            case "--b7" -> "-6";
            case "--7" -> "-#6";
            case "--b1" -> "-#6";
            case "-1" -> "-7";
            case "-#1" -> "1";
            case "-b2" -> "1";
            case "-2" -> "#1";
            case "-#2" -> "2";
            case "-b3" -> "2";
            case "-3" -> "#2";
            case "-b4" -> "#2";
            case "-4" -> "3";
            case "-#3" -> "3";
            case "-#4" -> "4";
            case "-b5" -> "4";
            case "-5" -> "#4";
            case "-#5" -> "5";
            case "-b6" -> "5";
            case "-6" -> "#5";
            case "-#6" -> "6";
            case "-b7" -> "6";
            case "-7" -> "#6";
            case "-b1" -> "#6";
            case "1" -> "7";
            case "#1" -> "+1";
            case "b2" -> "+1";
            case "2" -> "+#1";
            case "#2" -> "+2";
            case "b3" -> "+2";
            case "3" -> "+#2";
            case "b4" -> "+#2";
            case "4" -> "+3";
            case "#3" -> "+3";
            case "#4" -> "+4";
            case "b5" -> "+4";
            case "5" -> "+#4";
            case "#5" -> "+5";
            case "b6" -> "+5";
            case "6" -> "+#5";
            case "#6" -> "+6";
            case "b7" -> "+6";
            case "7" -> "+#6";
            case "+b1" -> "+#6";
            case "+1" -> "+7";
            case "+#1" -> "++1";
            case "+b2" -> "++1";
            case "+2" -> "++#1";
            case "+#2" -> "++2";
            case "+b3" -> "++2";
            case "+3" -> "++#2";
            case "+b4" -> "++#2";
            case "+4" -> "++3";
            case "+#3" -> "++3";
            case "+#4" -> "++4";
            case "+b5" -> "++4";
            case "+5" -> "++#4";
            case "+#5" -> "++5";
            case "+b6" -> "++5";
            case "+6" -> "++#5";
            case "+#6" -> "++6";
            case "+b7" -> "++6";
            case "+7" -> "++#6";
            case "++b1" -> "++#6";
            case "++1" -> "++7";
            case "++#1" -> "+++1";
            case "++b2" -> "+++1";
            case "++2" -> "+++#1";
            case "++#2" -> "+++2";
            case "++b3" -> "+++2";
            case "++3" -> "+++#2";
            case "++b4" -> "+++#2";
            case "++4" -> "+++3";
            case "++#3" -> "+++3";
            case "++#4" -> "+++4";
            case "++b5" -> "+++4";
            case "++5" -> "+++#4";
            case "++#5" -> "+++5";
            case "++b6" -> "+++5";
            case "++6" -> "+++#5";
            case "++#6" -> "+++6";
            case "++b7" -> "+++6";
            case "++7" -> "+++#6";
            case "+++b1" -> "+++#6";
            default -> note;
        };
    }

    //----------------------------------------------------------------


    //从其它调转到C调的实现方法
    private static String convertToC(String note, String originalKey) {
        return switch (originalKey) {
            case C_KEY, UP_B_KEY -> note;
            case UP_C_KEY, DOWN_D_KEY -> cSharpToC(note);
            case D_KEY -> dToC(note);
            case UP_D_KEY, DOWN_E_KEY -> dSharpToC(note);
            case E_KEY, DOWN_F_KEY -> eToC(note);
            case F_KEY, UP_E_KEY -> fToC(note);
            case UP_F_KEY, DOWN_G_KEY -> fSharpToC(note);
            case G_KEY -> gToC(note);
            case UP_G_KEY, DOWN_A_KEY -> gSharpToC(note);
            case A_KEY -> aToC(note);
            case UP_A_KEY, DOWN_B_KEY -> aSharpToC(note);
            case B_KEY, DOWN_C_KEY -> bToC(note);
            default -> note;
        };
    }


    private static String cSharpToC(String note) {
        return switch (note) {
            case "--1" -> "---7";
            case "--#1" -> "--1";
            case "--b2" -> "--1";
            case "--2" -> "--#1";
            case "--#2" -> "--2";
            case "--b3" -> "--2";
            case "--3" -> "--#2";
            case "--b4" -> "--#2";
            case "--4" -> "--3";
            case "--#3" -> "--3";
            case "--#4" -> "--4";
            case "--b5" -> "--4";
            case "--5" -> "--#4";
            case "--#5" -> "--5";
            case "--b6" -> "--5";
            case "--6" -> "--#5";
            case "--#6" -> "--6";
            case "--b7" -> "--6";
            case "--7" -> "--#6";
            case "--b1" -> "---#6";
            case "-1" -> "--7";
            case "-#1" -> "-1";
            case "-b2" -> "-1";
            case "-2" -> "-#1";
            case "-#2" -> "-2";
            case "-b3" -> "-2";
            case "-3" -> "-#2";
            case "-b4" -> "-#2";
            case "-4" -> "-3";
            case "-#3" -> "-3";
            case "-#4" -> "-4";
            case "-b5" -> "-4";
            case "-5" -> "-#4";
            case "-#5" -> "-5";
            case "-b6" -> "-5";
            case "-6" -> "-#5";
            case "-#6" -> "-6";
            case "-b7" -> "-6";
            case "-7" -> "-#6";
            case "-b1" -> "--#6";
            case "1" -> "-7";
            case "#1" -> "1";
            case "b2" -> "1";
            case "2" -> "#1";
            case "#2" -> "2";
            case "b3" -> "2";
            case "3" -> "#2";
            case "b4" -> "#2";
            case "4" -> "3";
            case "#3" -> "3";
            case "#4" -> "4";
            case "b5" -> "4";
            case "5" -> "#4";
            case "#5" -> "5";
            case "b6" -> "5";
            case "6" -> "#5";
            case "#6" -> "6";
            case "b7" -> "6";
            case "7" -> "#6";
            case "b1" -> "-#6";
            case "+1" -> "7";
            case "+#1" -> "+1";
            case "+b2" -> "+1";
            case "+2" -> "+#1";
            case "+#2" -> "+2";
            case "+b3" -> "+2";
            case "+3" -> "+#2";
            case "+b4" -> "+#2";
            case "+4" -> "+3";
            case "+#3" -> "+3";
            case "+#4" -> "+4";
            case "+b5" -> "+4";
            case "+5" -> "+#4";
            case "+#5" -> "+5";
            case "+b6" -> "+5";
            case "+6" -> "+#5";
            case "+#6" -> "+6";
            case "+b7" -> "+6";
            case "+7" -> "+#6";
            case "+b1" -> "#6";
            case "++1" -> "+7";
            case "++#1" -> "++1";
            case "++b2" -> "++1";
            case "++2" -> "++#1";
            case "++#2" -> "++2";
            case "++b3" -> "++2";
            case "++3" -> "++#2";
            case "++b4" -> "++#2";
            case "++4" -> "++3";
            case "++#3" -> "++3";
            case "++#4" -> "++4";
            case "++b5" -> "++4";
            case "++5" -> "++#4";
            case "++#5" -> "++5";
            case "++b6" -> "++5";
            case "++6" -> "++#5";
            case "++#6" -> "++6";
            case "++b7" -> "++6";
            case "++7" -> "++#6";
            case "++b1" -> "+#6";
            default -> note;
        };

    }


    private static String dToC(String note) {
        return switch (note) {
            case "--1" -> "---#6";
            case "--#1" -> "---7";
            case "--b2" -> "---7";
            case "--2" -> "--1";
            case "--#2" -> "--#1";
            case "--b3" -> "--#1";
            case "--3" -> "--2";
            case "--b4" -> "--2";
            case "--4" -> "--#2";
            case "--#3" -> "--#2";
            case "--#4" -> "--3";
            case "--b5" -> "--3";
            case "--5" -> "--4";
            case "--#5" -> "--#4";
            case "--b6" -> "--#4";
            case "--6" -> "--5";
            case "--#6" -> "--#5";
            case "--b7" -> "--#5";
            case "--7" -> "--6";
            case "--b1" -> "---6";
            case "-1" -> "--#6";
            case "-#1" -> "--7";
            case "-b2" -> "--7";
            case "-2" -> "-1";
            case "-#2" -> "-#1";
            case "-b3" -> "-#1";
            case "-3" -> "-2";
            case "-b4" -> "-2";
            case "-4" -> "-#2";
            case "-#3" -> "-#2";
            case "-#4" -> "-3";
            case "-b5" -> "-3";
            case "-5" -> "-4";
            case "-#5" -> "-#4";
            case "-b6" -> "-#4";
            case "-6" -> "-5";
            case "-#6" -> "-#5";
            case "-b7" -> "-#5";
            case "-7" -> "-6";
            case "-b1" -> "--6";
            case "1" -> "-#6";
            case "#1" -> "-7";
            case "b2" -> "-7";
            case "2" -> "1";
            case "#2" -> "#1";
            case "b3" -> "#1";
            case "3" -> "2";
            case "b4" -> "2";
            case "4" -> "#2";
            case "#3" -> "#2";
            case "#4" -> "3";
            case "b5" -> "3";
            case "5" -> "4";
            case "#5" -> "#4";
            case "b6" -> "#4";
            case "6" -> "5";
            case "#6" -> "#5";
            case "b7" -> "#5";
            case "7" -> "6";
            case "b1" -> "-6";
            case "+1" -> "#6";
            case "+#1" -> "7";
            case "+b2" -> "7";
            case "+2" -> "+1";
            case "+#2" -> "+#1";
            case "+b3" -> "+#1";
            case "+3" -> "+2";
            case "+b4" -> "+2";
            case "+4" -> "+#2";
            case "+#3" -> "+#2";
            case "+#4" -> "+3";
            case "+b5" -> "+3";
            case "+5" -> "+4";
            case "+#5" -> "+#4";
            case "+b6" -> "+#4";
            case "+6" -> "+5";
            case "+#6" -> "+#5";
            case "+b7" -> "+#5";
            case "+7" -> "+6";
            case "+b1" -> "6";
            case "++1" -> "+#6";
            case "++#1" -> "+7";
            case "++b2" -> "+7";
            case "++2" -> "++1";
            case "++#2" -> "++#1";
            case "++b3" -> "++#1";
            case "++3" -> "++2";
            case "++b4" -> "++2";
            case "++4" -> "++#2";
            case "++#3" -> "++#2";
            case "++#4" -> "++3";
            case "++b5" -> "++3";
            case "++5" -> "++4";
            case "++#5" -> "++#4";
            case "++b6" -> "++#4";
            case "++6" -> "++5";
            case "++#6" -> "++#5";
            case "++b7" -> "++#5";
            case "++7" -> "++6";
            case "++b1" -> "+6";
            default -> note;
        };
    }


    private static String dSharpToC(String note) {
        return switch (note) {
            case "--1" -> "---6";
            case "--#1" -> "---#6";
            case "--b2" -> "---#6";
            case "--2" -> "---7";
            case "--#2" -> "--1";
            case "--b3" -> "--1";
            case "--3" -> "--#1";
            case "--b4" -> "--#1";
            case "--4" -> "--2";
            case "--#3" -> "--2";
            case "--#4" -> "--#2";
            case "--b5" -> "--#2";
            case "--5" -> "--3";
            case "--#5" -> "--4";
            case "--b6" -> "--4";
            case "--6" -> "--#4";
            case "--#6" -> "--5";
            case "--b7" -> "--5";
            case "--7" -> "--#5";
            case "--b1" -> "---#5";
            case "-1" -> "--6";
            case "-#1" -> "--#6";
            case "-b2" -> "--#6";
            case "-2" -> "--7";
            case "-#2" -> "-1";
            case "-b3" -> "-1";
            case "-3" -> "-#1";
            case "-b4" -> "-#1";
            case "-4" -> "-2";
            case "-#3" -> "-2";
            case "-#4" -> "-#2";
            case "-b5" -> "-#2";
            case "-5" -> "-3";
            case "-#5" -> "-4";
            case "-b6" -> "-4";
            case "-6" -> "-#4";
            case "-#6" -> "-5";
            case "-b7" -> "-5";
            case "-7" -> "-#5";
            case "-b1" -> "--#5";
            case "1" -> "-6";
            case "#1" -> "-#6";
            case "b2" -> "-#6";
            case "2" -> "-7";
            case "#2" -> "1";
            case "b3" -> "1";
            case "3" -> "#1";
            case "b4" -> "#1";
            case "4" -> "2";
            case "#3" -> "2";
            case "#4" -> "#2";
            case "b5" -> "#2";
            case "5" -> "3";
            case "#5" -> "4";
            case "b6" -> "4";
            case "6" -> "#4";
            case "#6" -> "5";
            case "b7" -> "5";
            case "7" -> "#5";
            case "b1" -> "-#5";
            case "+1" -> "6";
            case "+#1" -> "#6";
            case "+b2" -> "#6";
            case "+2" -> "7";
            case "+#2" -> "+1";
            case "+b3" -> "+1";
            case "+3" -> "+#1";
            case "+b4" -> "+#1";
            case "+4" -> "+2";
            case "+#3" -> "+2";
            case "+#4" -> "+#2";
            case "+b5" -> "+#2";
            case "+5" -> "+3";
            case "+#5" -> "+4";
            case "+b6" -> "+4";
            case "+6" -> "+#4";
            case "+#6" -> "+5";
            case "+b7" -> "+5";
            case "+7" -> "+#5";
            case "+b1" -> "#5";
            case "++1" -> "+6";
            case "++#1" -> "+#6";
            case "++b2" -> "+#6";
            case "++2" -> "+7";
            case "++#2" -> "++1";
            case "++b3" -> "++1";
            case "++3" -> "++#1";
            case "++b4" -> "++#1";
            case "++4" -> "++2";
            case "++#3" -> "++2";
            case "++#4" -> "++#2";
            case "++b5" -> "++#2";
            case "++5" -> "++3";
            case "++#5" -> "++4";
            case "++b6" -> "++4";
            case "++6" -> "++#4";
            case "++#6" -> "++5";
            case "++b7" -> "++5";
            case "++7" -> "++#5";
            case "++b1" -> "+#5";
            default -> note;
        };
    }


    private static String eToC(String note) {
        return switch (note) {
            case "--1" -> "---#5";
            case "--#1" -> "---6";
            case "--b2" -> "---6";
            case "--2" -> "---#6";
            case "--#2" -> "---7";
            case "--b3" -> "---7";
            case "--3" -> "--1";
            case "--b4" -> "--1";
            case "--4" -> "--#1";
            case "--#3" -> "--#1";
            case "--#4" -> "--2";
            case "--b5" -> "--2";
            case "--5" -> "--#2";
            case "--#5" -> "--3";
            case "--b6" -> "--3";
            case "--6" -> "--4";
            case "--#6" -> "--#4";
            case "--b7" -> "--#4";
            case "--7" -> "--5";
            case "--b1" -> "---5";
            case "-1" -> "--#5";
            case "-#1" -> "--6";
            case "-b2" -> "--6";
            case "-2" -> "--#6";
            case "-#2" -> "--7";
            case "-b3" -> "--7";
            case "-3" -> "-1";
            case "-b4" -> "-1";
            case "-4" -> "-#1";
            case "-#3" -> "-#1";
            case "-#4" -> "-2";
            case "-b5" -> "-2";
            case "-5" -> "-#2";
            case "-#5" -> "-3";
            case "-b6" -> "-3";
            case "-6" -> "-4";
            case "-#6" -> "-#4";
            case "-b7" -> "-#4";
            case "-7" -> "-5";
            case "-b1" -> "--5";
            case "1" -> "-#5";
            case "#1" -> "-6";
            case "b2" -> "-6";
            case "2" -> "-#6";
            case "#2" -> "-7";
            case "b3" -> "-7";
            case "3" -> "1";
            case "b4" -> "1";
            case "4" -> "#1";
            case "#3" -> "#1";
            case "#4" -> "2";
            case "b5" -> "2";
            case "5" -> "#2";
            case "#5" -> "3";
            case "b6" -> "3";
            case "6" -> "4";
            case "#6" -> "#4";
            case "b7" -> "#4";
            case "7" -> "5";
            case "b1" -> "-5";
            case "+1" -> "#5";
            case "+#1" -> "6";
            case "+b2" -> "6";
            case "+2" -> "#6";
            case "+#2" -> "7";
            case "+b3" -> "7";
            case "+3" -> "+1";
            case "+b4" -> "+1";
            case "+4" -> "+#1";
            case "+#3" -> "+#1";
            case "+#4" -> "+2";
            case "+b5" -> "+2";
            case "+5" -> "+#2";
            case "+#5" -> "+3";
            case "+b6" -> "+3";
            case "+6" -> "+4";
            case "+#6" -> "+#4";
            case "+b7" -> "+#4";
            case "+7" -> "+5";
            case "+b1" -> "5";
            case "++1" -> "+#5";
            case "++#1" -> "+6";
            case "++b2" -> "+6";
            case "++2" -> "+#6";
            case "++#2" -> "+7";
            case "++b3" -> "+7";
            case "++3" -> "++1";
            case "++b4" -> "++1";
            case "++4" -> "++#1";
            case "++#3" -> "++#1";
            case "++#4" -> "++2";
            case "++b5" -> "++2";
            case "++5" -> "++#2";
            case "++#5" -> "++3";
            case "++b6" -> "++3";
            case "++6" -> "++4";
            case "++#6" -> "++#4";
            case "++b7" -> "++#4";
            case "++7" -> "++5";
            case "++b1" -> "+5";
            default -> note;
        };
    }


    private static String fToC(String note) {
        return switch (note) {
            case "--1" -> "---5";
            case "--#1" -> "---#5";
            case "--b2" -> "---#5";
            case "--2" -> "---6";
            case "--#2" -> "---#6";
            case "--b3" -> "---#6";
            case "--3" -> "---7";
            case "--b4" -> "---7";
            case "--4" -> "--1";
            case "--#3" -> "--1";
            case "--#4" -> "--#1";
            case "--b5" -> "--#1";
            case "--5" -> "--2";
            case "--#5" -> "--#2";
            case "--b6" -> "--#2";
            case "--6" -> "--3";
            case "--#6" -> "--4";
            case "--b7" -> "--4";
            case "--7" -> "--#4";
            case "--b1" -> "---#4";
            case "-1" -> "--5";
            case "-#1" -> "--#5";
            case "-b2" -> "--#5";
            case "-2" -> "--6";
            case "-#2" -> "--#6";
            case "-b3" -> "--#6";
            case "-3" -> "--7";
            case "-b4" -> "--7";
            case "-4" -> "-1";
            case "-#3" -> "-1";
            case "-#4" -> "-#1";
            case "-b5" -> "-#1";
            case "-5" -> "-2";
            case "-#5" -> "-#2";
            case "-b6" -> "-#2";
            case "-6" -> "-3";
            case "-#6" -> "-4";
            case "-b7" -> "-4";
            case "-7" -> "-#4";
            case "-b1" -> "--#4";
            case "1" -> "-5";
            case "#1" -> "-#5";
            case "b2" -> "-#5";
            case "2" -> "-6";
            case "#2" -> "-#6";
            case "b3" -> "-#6";
            case "3" -> "-7";
            case "b4" -> "-7";
            case "4" -> "1";
            case "#3" -> "1";
            case "#4" -> "#1";
            case "b5" -> "#1";
            case "5" -> "2";
            case "#5" -> "#2";
            case "b6" -> "#2";
            case "6" -> "3";
            case "#6" -> "4";
            case "b7" -> "4";
            case "7" -> "#4";
            case "b1" -> "-#4";
            case "+1" -> "5";
            case "+#1" -> "#5";
            case "+b2" -> "#5";
            case "+2" -> "6";
            case "+#2" -> "#6";
            case "+b3" -> "#6";
            case "+3" -> "7";
            case "+b4" -> "7";
            case "+4" -> "+1";
            case "+#3" -> "+1";
            case "+#4" -> "+#1";
            case "+b5" -> "+#1";
            case "+5" -> "+2";
            case "+#5" -> "+#2";
            case "+b6" -> "+#2";
            case "+6" -> "+3";
            case "+#6" -> "+4";
            case "+b7" -> "+4";
            case "+7" -> "+#4";
            case "+b1" -> "#4";
            case "++1" -> "+5";
            case "++#1" -> "+#5";
            case "++b2" -> "+#5";
            case "++2" -> "+6";
            case "++#2" -> "+#6";
            case "++b3" -> "+#6";
            case "++3" -> "+7";
            case "++b4" -> "+7";
            case "++4" -> "++1";
            case "++#3" -> "++1";
            case "++#4" -> "++#1";
            case "++b5" -> "++#1";
            case "++5" -> "++2";
            case "++#5" -> "++#2";
            case "++b6" -> "++#2";
            case "++6" -> "++3";
            case "++#6" -> "++4";
            case "++b7" -> "++4";
            case "++7" -> "++#4";
            case "++b1" -> "+#4";
            default -> note;
        };
    }


    private static String fSharpToC(String note) {
        return switch (note) {
            case "--1" -> "---#4";
            case "--#1" -> "---5";
            case "--b2" -> "---5";
            case "--2" -> "---#5";
            case "--#2" -> "---6";
            case "--b3" -> "---6";
            case "--3" -> "---#6";
            case "--b4" -> "---#6";
            case "--4" -> "---7";
            case "--#3" -> "---7";
            case "--#4" -> "--1";
            case "--b5" -> "--1";
            case "--5" -> "--#1";
            case "--#5" -> "--2";
            case "--b6" -> "--2";
            case "--6" -> "--#2";
            case "--#6" -> "--3";
            case "--b7" -> "--3";
            case "--7" -> "--4";
            case "--b1" -> "---4";
            case "-1" -> "--#4";
            case "-#1" -> "--5";
            case "-b2" -> "--5";
            case "-2" -> "--#5";
            case "-#2" -> "--6";
            case "-b3" -> "--6";
            case "-3" -> "--#6";
            case "-b4" -> "--#6";
            case "-4" -> "--7";
            case "-#3" -> "--7";
            case "-#4" -> "-1";
            case "-b5" -> "-1";
            case "-5" -> "-#1";
            case "-#5" -> "-2";
            case "-b6" -> "-2";
            case "-6" -> "-#2";
            case "-#6" -> "-3";
            case "-b7" -> "-3";
            case "-7" -> "-4";
            case "-b1" -> "--4";
            case "1" -> "-#4";
            case "#1" -> "-5";
            case "b2" -> "-5";
            case "2" -> "-#5";
            case "#2" -> "-6";
            case "b3" -> "-6";
            case "3" -> "-#6";
            case "b4" -> "-#6";
            case "4" -> "-7";
            case "#3" -> "-7";
            case "#4" -> "1";
            case "b5" -> "1";
            case "5" -> "#1";
            case "#5" -> "2";
            case "b6" -> "2";
            case "6" -> "#2";
            case "#6" -> "3";
            case "b7" -> "3";
            case "7" -> "4";
            case "b1" -> "-4";
            case "+1" -> "#4";
            case "+#1" -> "5";
            case "+b2" -> "5";
            case "+2" -> "#5";
            case "+#2" -> "6";
            case "+b3" -> "6";
            case "+3" -> "#6";
            case "+b4" -> "#6";
            case "+4" -> "7";
            case "+#3" -> "7";
            case "+#4" -> "+1";
            case "+b5" -> "+1";
            case "+5" -> "+#1";
            case "+#5" -> "+2";
            case "+b6" -> "+2";
            case "+6" -> "+#2";
            case "+#6" -> "+3";
            case "+b7" -> "+3";
            case "+7" -> "+4";
            case "+b1" -> "4";
            case "++1" -> "+#4";
            case "++#1" -> "+5";
            case "++b2" -> "+5";
            case "++2" -> "+#5";
            case "++#2" -> "+6";
            case "++b3" -> "+6";
            case "++3" -> "+#6";
            case "++b4" -> "+#6";
            case "++4" -> "+7";
            case "++#3" -> "+7";
            case "++#4" -> "++1";
            case "++b5" -> "++1";
            case "++5" -> "++#1";
            case "++#5" -> "++2";
            case "++b6" -> "++2";
            case "++6" -> "++#2";
            case "++#6" -> "++3";
            case "++b7" -> "++3";
            case "++7" -> "++4";
            case "++b1" -> "+4";
            default -> note;
        };
    }


    private static String gToC(String note) {
        return switch (note) {
            case "--1" -> "---4";
            case "--#1" -> "---#4";
            case "--b2" -> "---#4";
            case "--2" -> "---5";
            case "--#2" -> "---#5";
            case "--b3" -> "---#5";
            case "--3" -> "---6";
            case "--b4" -> "---6";
            case "--4" -> "---#6";
            case "--#3" -> "---#6";
            case "--#4" -> "---7";
            case "--b5" -> "---7";
            case "--5" -> "--1";
            case "--#5" -> "--#1";
            case "--b6" -> "--#1";
            case "--6" -> "--2";
            case "--#6" -> "--#2";
            case "--b7" -> "--#2";
            case "--7" -> "--3";
            case "--b1" -> "---3";
            case "-1" -> "--4";
            case "-#1" -> "--#4";
            case "-b2" -> "--#4";
            case "-2" -> "--5";
            case "-#2" -> "--#5";
            case "-b3" -> "--#5";
            case "-3" -> "--6";
            case "-b4" -> "--6";
            case "-4" -> "--#6";
            case "-#3" -> "--#6";
            case "-#4" -> "--7";
            case "-b5" -> "--7";
            case "-5" -> "-1";
            case "-#5" -> "-#1";
            case "-b6" -> "-#1";
            case "-6" -> "-2";
            case "-#6" -> "-#2";
            case "-b7" -> "-#2";
            case "-7" -> "-3";
            case "-b1" -> "--3";
            case "1" -> "-4";
            case "#1" -> "-#4";
            case "b2" -> "-#4";
            case "2" -> "-5";
            case "#2" -> "-#5";
            case "b3" -> "-#5";
            case "3" -> "-6";
            case "b4" -> "-6";
            case "4" -> "-#6";
            case "#3" -> "-#6";
            case "#4" -> "-7";
            case "b5" -> "-7";
            case "5" -> "1";
            case "#5" -> "#1";
            case "b6" -> "#1";
            case "6" -> "2";
            case "#6" -> "#2";
            case "b7" -> "#2";
            case "7" -> "3";
            case "b1" -> "-3";
            case "+1" -> "4";
            case "+#1" -> "#4";
            case "+b2" -> "#4";
            case "+2" -> "5";
            case "+#2" -> "#5";
            case "+b3" -> "#5";
            case "+3" -> "6";
            case "+b4" -> "6";
            case "+4" -> "#6";
            case "+#3" -> "#6";
            case "+#4" -> "7";
            case "+b5" -> "7";
            case "+5" -> "+1";
            case "+#5" -> "+#1";
            case "+b6" -> "+#1";
            case "+6" -> "+2";
            case "+#6" -> "+#2";
            case "+b7" -> "+#2";
            case "+7" -> "+3";
            case "+b1" -> "3";
            case "++1" -> "+4";
            case "++#1" -> "+#4";
            case "++b2" -> "+#4";
            case "++2" -> "+5";
            case "++#2" -> "+#5";
            case "++b3" -> "+#5";
            case "++3" -> "+6";
            case "++b4" -> "+6";
            case "++4" -> "+#6";
            case "++#3" -> "+#6";
            case "++#4" -> "+7";
            case "++b5" -> "+7";
            case "++5" -> "++1";
            case "++#5" -> "++#1";
            case "++b6" -> "++#1";
            case "++6" -> "++2";
            case "++#6" -> "++#2";
            case "++b7" -> "++#2";
            case "++7" -> "++3";
            case "++b1" -> "+3";
            default -> note;
        };
    }

    private static String gSharpToC(String note) {
        return switch (note) {
            case "--1" -> "---3";
            case "--#1" -> "---4";
            case "--b2" -> "---4";
            case "--2" -> "---#4";
            case "--#2" -> "---5";
            case "--b3" -> "---5";
            case "--3" -> "---#5";
            case "--b4" -> "---#5";
            case "--4" -> "---6";
            case "--#3" -> "---6";
            case "--#4" -> "---#6";
            case "--b5" -> "---#6";
            case "--5" -> "---7";
            case "--#5" -> "--1";
            case "--b6" -> "--1";
            case "--6" -> "--#1";
            case "--#6" -> "--2";
            case "--b7" -> "--2";
            case "--7" -> "--#2";
            case "--b1" -> "---#2";
            case "-1" -> "--3";
            case "-#1" -> "--4";
            case "-b2" -> "--4";
            case "-2" -> "--#4";
            case "-#2" -> "--5";
            case "-b3" -> "--5";
            case "-3" -> "--#5";
            case "-b4" -> "--#5";
            case "-4" -> "--6";
            case "-#3" -> "--6";
            case "-#4" -> "--#6";
            case "-b5" -> "--#6";
            case "-5" -> "--7";
            case "-#5" -> "-1";
            case "-b6" -> "-1";
            case "-6" -> "-#1";
            case "-#6" -> "-2";
            case "-b7" -> "-2";
            case "-7" -> "-#2";
            case "-b1" -> "--#2";
            case "1" -> "-3";
            case "#1" -> "-4";
            case "b2" -> "-4";
            case "2" -> "-#4";
            case "#2" -> "-5";
            case "b3" -> "-5";
            case "3" -> "-#5";
            case "b4" -> "-#5";
            case "4" -> "-6";
            case "#3" -> "-6";
            case "#4" -> "-#6";
            case "b5" -> "-#6";
            case "5" -> "-7";
            case "#5" -> "1";
            case "b6" -> "1";
            case "6" -> "#1";
            case "#6" -> "2";
            case "b7" -> "2";
            case "7" -> "#2";
            case "b1" -> "-#2";
            case "+1" -> "3";
            case "+#1" -> "4";
            case "+b2" -> "4";
            case "+2" -> "#4";
            case "+#2" -> "5";
            case "+b3" -> "5";
            case "+3" -> "#5";
            case "+b4" -> "#5";
            case "+4" -> "6";
            case "+#3" -> "6";
            case "+#4" -> "#6";
            case "+b5" -> "#6";
            case "+5" -> "7";
            case "+#5" -> "+1";
            case "+b6" -> "+1";
            case "+6" -> "+#1";
            case "+#6" -> "+2";
            case "+b7" -> "+2";
            case "+7" -> "+#2";
            case "+b1" -> "#2";
            case "++1" -> "+3";
            case "++#1" -> "+4";
            case "++b2" -> "+4";
            case "++2" -> "+#4";
            case "++#2" -> "+5";
            case "++b3" -> "+5";
            case "++3" -> "+#5";
            case "++b4" -> "+#5";
            case "++4" -> "+6";
            case "++#3" -> "+6";
            case "++#4" -> "+#6";
            case "++b5" -> "+#6";
            case "++5" -> "+7";
            case "++#5" -> "++1";
            case "++b6" -> "++1";
            case "++6" -> "++#1";
            case "++#6" -> "++2";
            case "++b7" -> "++2";
            case "++7" -> "++#2";
            case "++b1" -> "+#2";
            default -> note;
        };
    }


    private static String aToC(String note) {
        return switch (note) {
            case "--1" -> "---#2";
            case "--#1" -> "---3";
            case "--b2" -> "---3";
            case "--2" -> "---4";
            case "--#2" -> "---#4";
            case "--b3" -> "---#4";
            case "--3" -> "---5";
            case "--b4" -> "---5";
            case "--4" -> "---#5";
            case "--#3" -> "---#5";
            case "--#4" -> "---6";
            case "--b5" -> "---6";
            case "--5" -> "---#6";
            case "--#5" -> "---7";
            case "--b6" -> "---7";
            case "--6" -> "--1";
            case "--#6" -> "--#1";
            case "--b7" -> "--#1";
            case "--7" -> "--2";
            case "--b1" -> "---2";
            case "-1" -> "--#2";
            case "-#1" -> "--3";
            case "-b2" -> "--3";
            case "-2" -> "--4";
            case "-#2" -> "--#4";
            case "-b3" -> "--#4";
            case "-3" -> "--5";
            case "-b4" -> "--5";
            case "-4" -> "--#5";
            case "-#3" -> "--#5";
            case "-#4" -> "--6";
            case "-b5" -> "--6";
            case "-5" -> "--#6";
            case "-#5" -> "--7";
            case "-b6" -> "--7";
            case "-6" -> "-1";
            case "-#6" -> "-#1";
            case "-b7" -> "-#1";
            case "-7" -> "-2";
            case "-b1" -> "--2";
            case "1" -> "-#2";
            case "#1" -> "-3";
            case "b2" -> "-3";
            case "2" -> "-4";
            case "#2" -> "-#4";
            case "b3" -> "-#4";
            case "3" -> "-5";
            case "b4" -> "-5";
            case "4" -> "-#5";
            case "#3" -> "-#5";
            case "#4" -> "-6";
            case "b5" -> "-6";
            case "5" -> "-#6";
            case "#5" -> "-7";
            case "b6" -> "-7";
            case "6" -> "1";
            case "#6" -> "#1";
            case "b7" -> "#1";
            case "7" -> "2";
            case "b1" -> "-2";
            case "+1" -> "#2";
            case "+#1" -> "3";
            case "+b2" -> "3";
            case "+2" -> "4";
            case "+#2" -> "#4";
            case "+b3" -> "#4";
            case "+3" -> "5";
            case "+b4" -> "5";
            case "+4" -> "#5";
            case "+#3" -> "#5";
            case "+#4" -> "6";
            case "+b5" -> "6";
            case "+5" -> "#6";
            case "+#5" -> "7";
            case "+b6" -> "7";
            case "+6" -> "+1";
            case "+#6" -> "+#1";
            case "+b7" -> "+#1";
            case "+7" -> "+2";
            case "+b1" -> "2";
            case "++1" -> "+#2";
            case "++#1" -> "+3";
            case "++b2" -> "+3";
            case "++2" -> "+4";
            case "++#2" -> "+#4";
            case "++b3" -> "+#4";
            case "++3" -> "+5";
            case "++b4" -> "+5";
            case "++4" -> "+#5";
            case "++#3" -> "+#5";
            case "++#4" -> "+6";
            case "++b5" -> "+6";
            case "++5" -> "+#6";
            case "++#5" -> "+7";
            case "++b6" -> "+7";
            case "++6" -> "++1";
            case "++#6" -> "++#1";
            case "++b7" -> "++#1";
            case "++7" -> "++2";
            case "++b1" -> "+2";
            default -> note;
        };
    }


    private static String aSharpToC(String note) {
        return switch (note) {
            case "--1" -> "---2";
            case "--#1" -> "---#2";
            case "--b2" -> "---#2";
            case "--2" -> "---3";
            case "--#2" -> "---4";
            case "--b3" -> "---4";
            case "--3" -> "---#4";
            case "--b4" -> "---#4";
            case "--4" -> "---5";
            case "--#3" -> "---5";
            case "--#4" -> "---#5";
            case "--b5" -> "---#5";
            case "--5" -> "---6";
            case "--#5" -> "---#6";
            case "--b6" -> "---#6";
            case "--6" -> "---7";
            case "--#6" -> "--1";
            case "--b7" -> "--1";
            case "--7" -> "--#1";
            case "--b1" -> "---#1";
            case "-1" -> "--2";
            case "-#1" -> "--#2";
            case "-b2" -> "--#2";
            case "-2" -> "--3";
            case "-#2" -> "--4";
            case "-b3" -> "--4";
            case "-3" -> "--#4";
            case "-b4" -> "--#4";
            case "-4" -> "--5";
            case "-#3" -> "--5";
            case "-#4" -> "--#5";
            case "-b5" -> "--#5";
            case "-5" -> "--6";
            case "-#5" -> "--#6";
            case "-b6" -> "--#6";
            case "-6" -> "--7";
            case "-#6" -> "-1";
            case "-b7" -> "-1";
            case "-7" -> "-#1";
            case "-b1" -> "--#1";
            case "1" -> "-2";
            case "#1" -> "-#2";
            case "b2" -> "-#2";
            case "2" -> "-3";
            case "#2" -> "-4";
            case "b3" -> "-4";
            case "3" -> "-#4";
            case "b4" -> "-#4";
            case "4" -> "-5";
            case "#3" -> "-5";
            case "#4" -> "-#5";
            case "b5" -> "-#5";
            case "5" -> "-6";
            case "#5" -> "-#6";
            case "b6" -> "-#6";
            case "6" -> "-7";
            case "#6" -> "1";
            case "b7" -> "1";
            case "7" -> "#1";
            case "b1" -> "-#1";
            case "+1" -> "2";
            case "+#1" -> "#2";
            case "+b2" -> "#2";
            case "+2" -> "3";
            case "+#2" -> "4";
            case "+b3" -> "4";
            case "+3" -> "#4";
            case "+b4" -> "#4";
            case "+4" -> "5";
            case "+#3" -> "5";
            case "+#4" -> "#5";
            case "+b5" -> "#5";
            case "+5" -> "6";
            case "+#5" -> "#6";
            case "+b6" -> "#6";
            case "+6" -> "7";
            case "+#6" -> "+1";
            case "+b7" -> "+1";
            case "+7" -> "+#1";
            case "+b1" -> "#1";
            case "++1" -> "+2";
            case "++#1" -> "+#2";
            case "++b2" -> "+#2";
            case "++2" -> "+3";
            case "++#2" -> "+4";
            case "++b3" -> "+4";
            case "++3" -> "+#4";
            case "++b4" -> "+#4";
            case "++4" -> "+5";
            case "++#3" -> "+5";
            case "++#4" -> "+#5";
            case "++b5" -> "+#5";
            case "++5" -> "+6";
            case "++#5" -> "+#6";
            case "++b6" -> "+#6";
            case "++6" -> "+7";
            case "++#6" -> "++1";
            case "++b7" -> "++1";
            case "++7" -> "++#1";
            case "++b1" -> "+#1";
            default -> note;
        };
    }


    private static String bToC(String note) {
        return switch (note) {
            case "--1" -> "---#1";
            case "--#1" -> "---2";
            case "--b2" -> "---2";
            case "--2" -> "---#2";
            case "--#2" -> "---3";
            case "--b3" -> "---3";
            case "--3" -> "---4";
            case "--b4" -> "---4";
            case "--4" -> "---#4";
            case "--#3" -> "---#4";
            case "--#4" -> "---5";
            case "--b5" -> "---5";
            case "--5" -> "---#5";
            case "--#5" -> "---6";
            case "--b6" -> "---6";
            case "--6" -> "---#6";
            case "--#6" -> "---7";
            case "--b7" -> "---7";
            case "--7" -> "--1";
            case "--b1" -> "---1";
            case "-1" -> "--#1";
            case "-#1" -> "--2";
            case "-b2" -> "--2";
            case "-2" -> "--#2";
            case "-#2" -> "--3";
            case "-b3" -> "--3";
            case "-3" -> "--4";
            case "-b4" -> "--4";
            case "-4" -> "--#4";
            case "-#3" -> "--#4";
            case "-#4" -> "--5";
            case "-b5" -> "--5";
            case "-5" -> "--#5";
            case "-#5" -> "--6";
            case "-b6" -> "--6";
            case "-6" -> "--#6";
            case "-#6" -> "--7";
            case "-b7" -> "--7";
            case "-7" -> "-1";
            case "-b1" -> "--1";
            case "1" -> "-#1";
            case "#1" -> "-2";
            case "b2" -> "-2";
            case "2" -> "-#2";
            case "#2" -> "-3";
            case "b3" -> "-3";
            case "3" -> "-4";
            case "b4" -> "-4";
            case "4" -> "-#4";
            case "#3" -> "-#4";
            case "#4" -> "-5";
            case "b5" -> "-5";
            case "5" -> "-#5";
            case "#5" -> "-6";
            case "b6" -> "-6";
            case "6" -> "-#6";
            case "#6" -> "-7";
            case "b7" -> "-7";
            case "7" -> "1";
            case "b1" -> "-1";
            case "+1" -> "#1";
            case "+#1" -> "2";
            case "+b2" -> "2";
            case "+2" -> "#2";
            case "+#2" -> "3";
            case "+b3" -> "3";
            case "+3" -> "4";
            case "+b4" -> "4";
            case "+4" -> "#4";
            case "+#3" -> "#4";
            case "+#4" -> "5";
            case "+b5" -> "5";
            case "+5" -> "#5";
            case "+#5" -> "6";
            case "+b6" -> "6";
            case "+6" -> "#6";
            case "+#6" -> "7";
            case "+b7" -> "7";
            case "+7" -> "+1";
            case "+b1" -> "1";
            case "++1" -> "+#1";
            case "++#1" -> "+2";
            case "++b2" -> "+2";
            case "++2" -> "+#2";
            case "++#2" -> "+3";
            case "++b3" -> "+3";
            case "++3" -> "+4";
            case "++b4" -> "+4";
            case "++4" -> "+#4";
            case "++#3" -> "+#4";
            case "++#4" -> "+5";
            case "++b5" -> "+5";
            case "++5" -> "+#5";
            case "++#5" -> "+6";
            case "++b6" -> "+6";
            case "++6" -> "+#6";
            case "++#6" -> "+7";
            case "++b7" -> "+7";
            case "++7" -> "++1";
            case "++b1" -> "+1";
            default -> note;
        };
    }


    //----------------------------------------------------------
    //从C调转到指定的调式的实现方法
    private static String convertFromC(String note, String targetKey) {
        return switch (targetKey) {
            case C_KEY, UP_B_KEY -> note;
            case UP_C_KEY, DOWN_D_KEY -> cToCSharp(note);
            case D_KEY -> cToD(note);
            case UP_D_KEY, DOWN_E_KEY -> cToDSharp(note);
            case E_KEY, DOWN_F_KEY -> cToE(note);
            case F_KEY, UP_E_KEY -> cToF(note);
            case UP_F_KEY, DOWN_G_KEY -> cToFSharp(note);
            case G_KEY -> cToG(note);
            case UP_G_KEY, DOWN_A_KEY -> cToGSharp(note);
            case A_KEY -> cToA(note);
            case UP_A_KEY, DOWN_B_KEY -> cToASharp(note);
            case B_KEY, DOWN_C_KEY -> cToB(note);
            default -> note;
        };
    }


    private static String cToB(String note) {

        return switch (note) {
            case "--1" -> "---7";
            case "--#1" -> "--1";
            case "--b2" -> "--1";
            case "--2" -> "--#1";
            case "--#2" -> "--2";
            case "--b3" -> "--2";
            case "--3" -> "--#2";
            case "--b4" -> "--#2";
            case "--4" -> "--3";
            case "--#3" -> "--3";
            case "--#4" -> "--4";
            case "--b5" -> "--4";
            case "--5" -> "--#4";
            case "--#5" -> "--5";
            case "--b6" -> "--5";
            case "--6" -> "--#5";
            case "--#6" -> "--6";
            case "--b7" -> "--6";
            case "--7" -> "--#6";
            case "--b1" -> "---#6";
            case "-1" -> "--7";
            case "-#1" -> "-1";
            case "-b2" -> "-1";
            case "-2" -> "-#1";
            case "-#2" -> "-2";
            case "-b3" -> "-2";
            case "-3" -> "-#2";
            case "-b4" -> "-#2";
            case "-4" -> "-3";
            case "-#3" -> "-3";
            case "-#4" -> "-4";
            case "-b5" -> "-4";
            case "-5" -> "-#4";
            case "-#5" -> "-5";
            case "-b6" -> "-5";
            case "-6" -> "-#5";
            case "-#6" -> "-6";
            case "-b7" -> "-6";
            case "-7" -> "-#6";
            case "-b1" -> "--#6";
            case "1" -> "-7";
            case "#1" -> "1";
            case "b2" -> "1";
            case "2" -> "#1";
            case "#2" -> "2";
            case "b3" -> "2";
            case "3" -> "#2";
            case "b4" -> "#2";
            case "4" -> "3";
            case "#3" -> "3";
            case "#4" -> "4";
            case "b5" -> "4";
            case "5" -> "#4";
            case "#5" -> "5";
            case "b6" -> "5";
            case "6" -> "#5";
            case "#6" -> "6";
            case "b7" -> "6";
            case "7" -> "#6";
            case "b1" -> "-#6";
            case "+1" -> "7";
            case "+#1" -> "+1";
            case "+b2" -> "+1";
            case "+2" -> "+#1";
            case "+#2" -> "+2";
            case "+b3" -> "+2";
            case "+3" -> "+#2";
            case "+b4" -> "+#2";
            case "+4" -> "+3";
            case "+#3" -> "+3";
            case "+#4" -> "+4";
            case "+b5" -> "+4";
            case "+5" -> "+#4";
            case "+#5" -> "+5";
            case "+b6" -> "+5";
            case "+6" -> "+#5";
            case "+#6" -> "+6";
            case "+b7" -> "+6";
            case "+7" -> "+#6";
            case "+b1" -> "#6";
            case "++1" -> "+7";
            case "++#1" -> "++1";
            case "++b2" -> "++1";
            case "++2" -> "++#1";
            case "++#2" -> "++2";
            case "++b3" -> "++2";
            case "++3" -> "++#2";
            case "++b4" -> "++#2";
            case "++4" -> "++3";
            case "++#3" -> "++3";
            case "++#4" -> "++4";
            case "++b5" -> "++4";
            case "++5" -> "++#4";
            case "++#5" -> "++5";
            case "++b6" -> "++5";
            case "++6" -> "++#5";
            case "++#6" -> "++6";
            case "++b7" -> "++6";
            case "++7" -> "++#6";
            case "++b1" -> "+#6";
            default -> note;
        };
    }


    private static String cToASharp(String note) {
        return switch (note) {
            case "--1" -> "---#6";
            case "--#1" -> "---7";
            case "--b2" -> "---7";
            case "--2" -> "--1";
            case "--#2" -> "--#1";
            case "--b3" -> "--#1";
            case "--3" -> "--2";
            case "--b4" -> "--2";
            case "--4" -> "--#2";
            case "--#3" -> "--#2";
            case "--#4" -> "--3";
            case "--b5" -> "--3";
            case "--5" -> "--4";
            case "--#5" -> "--#4";
            case "--b6" -> "--#4";
            case "--6" -> "--5";
            case "--#6" -> "--#5";
            case "--b7" -> "--#5";
            case "--7" -> "--6";
            case "--b1" -> "---6";
            case "-1" -> "--#6";
            case "-#1" -> "--7";
            case "-b2" -> "--7";
            case "-2" -> "-1";
            case "-#2" -> "-#1";
            case "-b3" -> "-#1";
            case "-3" -> "-2";
            case "-b4" -> "-2";
            case "-4" -> "-#2";
            case "-#3" -> "-#2";
            case "-#4" -> "-3";
            case "-b5" -> "-3";
            case "-5" -> "-4";
            case "-#5" -> "-#4";
            case "-b6" -> "-#4";
            case "-6" -> "-5";
            case "-#6" -> "-#5";
            case "-b7" -> "-#5";
            case "-7" -> "-6";
            case "-b1" -> "--6";
            case "1" -> "-#6";
            case "#1" -> "-7";
            case "b2" -> "-7";
            case "2" -> "1";
            case "#2" -> "#1";
            case "b3" -> "#1";
            case "3" -> "2";
            case "b4" -> "2";
            case "4" -> "#2";
            case "#3" -> "#2";
            case "#4" -> "3";
            case "b5" -> "3";
            case "5" -> "4";
            case "#5" -> "#4";
            case "b6" -> "#4";
            case "6" -> "5";
            case "#6" -> "#5";
            case "b7" -> "#5";
            case "7" -> "6";
            case "b1" -> "-6";
            case "+1" -> "#6";
            case "+#1" -> "7";
            case "+b2" -> "7";
            case "+2" -> "+1";
            case "+#2" -> "+#1";
            case "+b3" -> "+#1";
            case "+3" -> "+2";
            case "+b4" -> "+2";
            case "+4" -> "+#2";
            case "+#3" -> "+#2";
            case "+#4" -> "+3";
            case "+b5" -> "+3";
            case "+5" -> "+4";
            case "+#5" -> "+#4";
            case "+b6" -> "+#4";
            case "+6" -> "+5";
            case "+#6" -> "+#5";
            case "+b7" -> "+#5";
            case "+7" -> "+6";
            case "+b1" -> "6";
            case "++1" -> "+#6";
            case "++#1" -> "+7";
            case "++b2" -> "+7";
            case "++2" -> "++1";
            case "++#2" -> "++#1";
            case "++b3" -> "++#1";
            case "++3" -> "++2";
            case "++b4" -> "++2";
            case "++4" -> "++#2";
            case "++#3" -> "++#2";
            case "++#4" -> "++3";
            case "++b5" -> "++3";
            case "++5" -> "++4";
            case "++#5" -> "++#4";
            case "++b6" -> "++#4";
            case "++6" -> "++5";
            case "++#6" -> "++#5";
            case "++b7" -> "++#5";
            case "++7" -> "++6";
            case "++b1" -> "+6";
            default -> note;
        };
    }


    private static String cToA(String note) {
        return switch (note) {
            case "--1" -> "---6";
            case "--#1" -> "---#6";
            case "--b2" -> "---#6";
            case "--2" -> "---7";
            case "--#2" -> "--1";
            case "--b3" -> "--1";
            case "--3" -> "--#1";
            case "--b4" -> "--#1";
            case "--4" -> "--2";
            case "--#3" -> "--2";
            case "--#4" -> "--#2";
            case "--b5" -> "--#2";
            case "--5" -> "--3";
            case "--#5" -> "--4";
            case "--b6" -> "--4";
            case "--6" -> "--#4";
            case "--#6" -> "--5";
            case "--b7" -> "--5";
            case "--7" -> "--#5";
            case "--b1" -> "---#5";
            case "-1" -> "--6";
            case "-#1" -> "--#6";
            case "-b2" -> "--#6";
            case "-2" -> "--7";
            case "-#2" -> "-1";
            case "-b3" -> "-1";
            case "-3" -> "-#1";
            case "-b4" -> "-#1";
            case "-4" -> "-2";
            case "-#3" -> "-2";
            case "-#4" -> "-#2";
            case "-b5" -> "-#2";
            case "-5" -> "-3";
            case "-#5" -> "-4";
            case "-b6" -> "-4";
            case "-6" -> "-#4";
            case "-#6" -> "-5";
            case "-b7" -> "-5";
            case "-7" -> "-#5";
            case "-b1" -> "--#5";
            case "1" -> "-6";
            case "#1" -> "-#6";
            case "b2" -> "-#6";
            case "2" -> "-7";
            case "#2" -> "1";
            case "b3" -> "1";
            case "3" -> "#1";
            case "b4" -> "#1";
            case "4" -> "2";
            case "#3" -> "2";
            case "#4" -> "#2";
            case "b5" -> "#2";
            case "5" -> "3";
            case "#5" -> "4";
            case "b6" -> "4";
            case "6" -> "#4";
            case "#6" -> "5";
            case "b7" -> "5";
            case "7" -> "#5";
            case "b1" -> "-#5";
            case "+1" -> "6";
            case "+#1" -> "#6";
            case "+b2" -> "#6";
            case "+2" -> "7";
            case "+#2" -> "+1";
            case "+b3" -> "+1";
            case "+3" -> "+#1";
            case "+b4" -> "+#1";
            case "+4" -> "+2";
            case "+#3" -> "+2";
            case "+#4" -> "+#2";
            case "+b5" -> "+#2";
            case "+5" -> "+3";
            case "+#5" -> "+4";
            case "+b6" -> "+4";
            case "+6" -> "+#4";
            case "+#6" -> "+5";
            case "+b7" -> "+5";
            case "+7" -> "+#5";
            case "+b1" -> "#5";
            case "++1" -> "+6";
            case "++#1" -> "+#6";
            case "++b2" -> "+#6";
            case "++2" -> "+7";
            case "++#2" -> "++1";
            case "++b3" -> "++1";
            case "++3" -> "++#1";
            case "++b4" -> "++#1";
            case "++4" -> "++2";
            case "++#3" -> "++2";
            case "++#4" -> "++#2";
            case "++b5" -> "++#2";
            case "++5" -> "++3";
            case "++#5" -> "++4";
            case "++b6" -> "++4";
            case "++6" -> "++#4";
            case "++#6" -> "++5";
            case "++b7" -> "++5";
            case "++7" -> "++#5";
            case "++b1" -> "+#5";
            default -> note;
        };
    }


    private static String cToGSharp(String note) {
        return switch (note) {
            case "--1" -> "---#5";
            case "--#1" -> "---6";
            case "--b2" -> "---6";
            case "--2" -> "---#6";
            case "--#2" -> "---7";
            case "--b3" -> "---7";
            case "--3" -> "--1";
            case "--b4" -> "--1";
            case "--4" -> "--#1";
            case "--#3" -> "--#1";
            case "--#4" -> "--2";
            case "--b5" -> "--2";
            case "--5" -> "--#2";
            case "--#5" -> "--3";
            case "--b6" -> "--3";
            case "--6" -> "--4";
            case "--#6" -> "--#4";
            case "--b7" -> "--#4";
            case "--7" -> "--5";
            case "--b1" -> "---5";
            case "-1" -> "--#5";
            case "-#1" -> "--6";
            case "-b2" -> "--6";
            case "-2" -> "--#6";
            case "-#2" -> "--7";
            case "-b3" -> "--7";
            case "-3" -> "-1";
            case "-b4" -> "-1";
            case "-4" -> "-#1";
            case "-#3" -> "-#1";
            case "-#4" -> "-2";
            case "-b5" -> "-2";
            case "-5" -> "-#2";
            case "-#5" -> "-3";
            case "-b6" -> "-3";
            case "-6" -> "-4";
            case "-#6" -> "-#4";
            case "-b7" -> "-#4";
            case "-7" -> "-5";
            case "-b1" -> "--5";
            case "1" -> "-#5";
            case "#1" -> "-6";
            case "b2" -> "-6";
            case "2" -> "-#6";
            case "#2" -> "-7";
            case "b3" -> "-7";
            case "3" -> "1";
            case "b4" -> "1";
            case "4" -> "#1";
            case "#3" -> "#1";
            case "#4" -> "2";
            case "b5" -> "2";
            case "5" -> "#2";
            case "#5" -> "3";
            case "b6" -> "3";
            case "6" -> "4";
            case "#6" -> "#4";
            case "b7" -> "#4";
            case "7" -> "5";
            case "b1" -> "-5";
            case "+1" -> "#5";
            case "+#1" -> "6";
            case "+b2" -> "6";
            case "+2" -> "#6";
            case "+#2" -> "7";
            case "+b3" -> "7";
            case "+3" -> "+1";
            case "+b4" -> "+1";
            case "+4" -> "+#1";
            case "+#3" -> "+#1";
            case "+#4" -> "+2";
            case "+b5" -> "+2";
            case "+5" -> "+#2";
            case "+#5" -> "+3";
            case "+b6" -> "+3";
            case "+6" -> "+4";
            case "+#6" -> "+#4";
            case "+b7" -> "+#4";
            case "+7" -> "+5";
            case "+b1" -> "5";
            case "++1" -> "+#5";
            case "++#1" -> "+6";
            case "++b2" -> "+6";
            case "++2" -> "+#6";
            case "++#2" -> "+7";
            case "++b3" -> "+7";
            case "++3" -> "++1";
            case "++b4" -> "++1";
            case "++4" -> "++#1";
            case "++#3" -> "++#1";
            case "++#4" -> "++2";
            case "++b5" -> "++2";
            case "++5" -> "++#2";
            case "++#5" -> "++3";
            case "++b6" -> "++3";
            case "++6" -> "++4";
            case "++#6" -> "++#4";
            case "++b7" -> "++#4";
            case "++7" -> "++5";
            case "++b1" -> "+5";
            default -> note;
        };

    }


    private static String cToG(String note) {
        return switch (note) {
            case "--1" -> "---5";
            case "--#1" -> "---#5";
            case "--b2" -> "---#5";
            case "--2" -> "---6";
            case "--#2" -> "---#6";
            case "--b3" -> "---#6";
            case "--3" -> "---7";
            case "--b4" -> "---7";
            case "--4" -> "--1";
            case "--#3" -> "--1";
            case "--#4" -> "--#1";
            case "--b5" -> "--#1";
            case "--5" -> "--2";
            case "--#5" -> "--#2";
            case "--b6" -> "--#2";
            case "--6" -> "--3";
            case "--#6" -> "--4";
            case "--b7" -> "--4";
            case "--7" -> "--#4";
            case "--b1" -> "---#4";
            case "-1" -> "--5";
            case "-#1" -> "--#5";
            case "-b2" -> "--#5";
            case "-2" -> "--6";
            case "-#2" -> "--#6";
            case "-b3" -> "--#6";
            case "-3" -> "--7";
            case "-b4" -> "--7";
            case "-4" -> "-1";
            case "-#3" -> "-1";
            case "-#4" -> "-#1";
            case "-b5" -> "-#1";
            case "-5" -> "-2";
            case "-#5" -> "-#2";
            case "-b6" -> "-#2";
            case "-6" -> "-3";
            case "-#6" -> "-4";
            case "-b7" -> "-4";
            case "-7" -> "-#4";
            case "-b1" -> "--#4";
            case "1" -> "-5";
            case "#1" -> "-#5";
            case "b2" -> "-#5";
            case "2" -> "-6";
            case "#2" -> "-#6";
            case "b3" -> "-#6";
            case "3" -> "-7";
            case "b4" -> "-7";
            case "4" -> "1";
            case "#3" -> "1";
            case "#4" -> "#1";
            case "b5" -> "#1";
            case "5" -> "2";
            case "#5" -> "#2";
            case "b6" -> "#2";
            case "6" -> "3";
            case "#6" -> "4";
            case "b7" -> "4";
            case "7" -> "#4";
            case "b1" -> "-#4";
            case "+1" -> "5";
            case "+#1" -> "#5";
            case "+b2" -> "#5";
            case "+2" -> "6";
            case "+#2" -> "#6";
            case "+b3" -> "#6";
            case "+3" -> "7";
            case "+b4" -> "7";
            case "+4" -> "+1";
            case "+#3" -> "+1";
            case "+#4" -> "+#1";
            case "+b5" -> "+#1";
            case "+5" -> "+2";
            case "+#5" -> "+#2";
            case "+b6" -> "+#2";
            case "+6" -> "+3";
            case "+#6" -> "+4";
            case "+b7" -> "+4";
            case "+7" -> "+#4";
            case "+b1" -> "#4";
            case "++1" -> "+5";
            case "++#1" -> "+#5";
            case "++b2" -> "+#5";
            case "++2" -> "+6";
            case "++#2" -> "+#6";
            case "++b3" -> "+#6";
            case "++3" -> "+7";
            case "++b4" -> "+7";
            case "++4" -> "++1";
            case "++#3" -> "++1";
            case "++#4" -> "++#1";
            case "++b5" -> "++#1";
            case "++5" -> "++2";
            case "++#5" -> "++#2";
            case "++b6" -> "++#2";
            case "++6" -> "++3";
            case "++#6" -> "++4";
            case "++b7" -> "++4";
            case "++7" -> "++#4";
            case "++b1" -> "+#4";
            default -> note;
        };

    }


    private static String cToFSharp(String note) {
        return switch (note) {
            case "--1" -> "---#4";
            case "--#1" -> "---5";
            case "--b2" -> "---5";
            case "--2" -> "---#5";
            case "--#2" -> "---6";
            case "--b3" -> "---6";
            case "--3" -> "---#6";
            case "--b4" -> "---#6";
            case "--4" -> "---7";
            case "--#3" -> "---7";
            case "--#4" -> "--1";
            case "--b5" -> "--1";
            case "--5" -> "--#1";
            case "--#5" -> "--2";
            case "--b6" -> "--2";
            case "--6" -> "--#2";
            case "--#6" -> "--3";
            case "--b7" -> "--3";
            case "--7" -> "--4";
            case "--b1" -> "---4";
            case "-1" -> "--#4";
            case "-#1" -> "--5";
            case "-b2" -> "--5";
            case "-2" -> "--#5";
            case "-#2" -> "--6";
            case "-b3" -> "--6";
            case "-3" -> "--#6";
            case "-b4" -> "--#6";
            case "-4" -> "--7";
            case "-#3" -> "--7";
            case "-#4" -> "-1";
            case "-b5" -> "-1";
            case "-5" -> "-#1";
            case "-#5" -> "-2";
            case "-b6" -> "-2";
            case "-6" -> "-#2";
            case "-#6" -> "-3";
            case "-b7" -> "-3";
            case "-7" -> "-4";
            case "-b1" -> "--4";
            case "1" -> "-#4";
            case "#1" -> "-5";
            case "b2" -> "-5";
            case "2" -> "-#5";
            case "#2" -> "-6";
            case "b3" -> "-6";
            case "3" -> "-#6";
            case "b4" -> "-#6";
            case "4" -> "-7";
            case "#3" -> "-7";
            case "#4" -> "1";
            case "b5" -> "1";
            case "5" -> "#1";
            case "#5" -> "2";
            case "b6" -> "2";
            case "6" -> "#2";
            case "#6" -> "3";
            case "b7" -> "3";
            case "7" -> "4";
            case "b1" -> "-4";
            case "+1" -> "#4";
            case "+#1" -> "5";
            case "+b2" -> "5";
            case "+2" -> "#5";
            case "+#2" -> "6";
            case "+b3" -> "6";
            case "+3" -> "#6";
            case "+b4" -> "#6";
            case "+4" -> "7";
            case "+#3" -> "7";
            case "+#4" -> "+1";
            case "+b5" -> "+1";
            case "+5" -> "+#1";
            case "+#5" -> "+2";
            case "+b6" -> "+2";
            case "+6" -> "+#2";
            case "+#6" -> "+3";
            case "+b7" -> "+3";
            case "+7" -> "+4";
            case "+b1" -> "4";
            case "++1" -> "+#4";
            case "++#1" -> "+5";
            case "++b2" -> "+5";
            case "++2" -> "+#5";
            case "++#2" -> "+6";
            case "++b3" -> "+6";
            case "++3" -> "+#6";
            case "++b4" -> "+#6";
            case "++4" -> "+7";
            case "++#3" -> "+7";
            case "++#4" -> "++1";
            case "++b5" -> "++1";
            case "++5" -> "++#1";
            case "++#5" -> "++2";
            case "++b6" -> "++2";
            case "++6" -> "++#2";
            case "++#6" -> "++3";
            case "++b7" -> "++3";
            case "++7" -> "++4";
            case "++b1" -> "+4";
            default -> note;
        };
    }


    private static String cToF(String note) {
        return switch (note) {
            case "--1" -> "--4";
            case "--#1", "--b2" -> "--#4";
            case "--2" -> "--5";
            case "--#2" -> "--#5";
            case "--b3" -> "--#5";
            case "--3" -> "--6";
            case "--b4" -> "--6";
            case "--4" -> "--#6";
            case "--#3" -> "--#6";
            case "--#4" -> "--7";
            case "--b5" -> "--7";
            case "--5" -> "-1";
            case "--#5" -> "-#1";
            case "--b6" -> "-#1";
            case "--6" -> "-2";
            case "--#6" -> "-#2";
            case "--b7" -> "-#2";
            case "--7" -> "-3";
            case "--b1" -> "-3";
            case "-1" -> "-4";
            case "-#1" -> "-#4";
            case "-b2" -> "-#4";
            case "-2" -> "-5";
            case "-#2" -> "-#5";
            case "-b3" -> "-#5";
            case "-3" -> "-6";
            case "-b4" -> "-6";
            case "-4" -> "-#6";
            case "-#3" -> "-#6";
            case "-#4" -> "-7";
            case "-b5" -> "-7";
            case "-5" -> "1";
            case "-#5" -> "#1";
            case "-b6" -> "#1";
            case "-6" -> "2";
            case "-#6" -> "#2";
            case "-b7" -> "#2";
            case "-7" -> "3";
            case "-b1" -> "3";
            case "1" -> "4";
            case "#1" -> "#4";
            case "b2" -> "#4";
            case "2" -> "5";
            case "#2" -> "#5";
            case "b3" -> "#5";
            case "3" -> "6";
            case "b4" -> "6";
            case "4" -> "#6";
            case "#3" -> "#6";
            case "#4" -> "7";
            case "b5" -> "7";
            case "5" -> "+1";
            case "#5" -> "+#1";
            case "b6" -> "+#1";
            case "6" -> "+2";
            case "#6" -> "+#2";
            case "b7" -> "+#2";
            case "7" -> "+3";
            case "+b1" -> "+3";
            case "+1" -> "+4";
            case "+#1" -> "+#4";
            case "+b2" -> "+#4";
            case "+2" -> "+5";
            case "+#2" -> "+#5";
            case "+b3" -> "+#5";
            case "+3" -> "+6";
            case "+b4" -> "+6";
            case "+4" -> "+#6";
            case "+#3" -> "+#6";
            case "+#4" -> "+7";
            case "+b5" -> "+7";
            case "+5" -> "++1";
            case "+#5" -> "++#1";
            case "+b6" -> "++#1";
            case "+6" -> "++2";
            case "+#6" -> "++#2";
            case "+b7" -> "++#2";
            case "+7" -> "++3";
            case "++b1" -> "++3";
            case "++1" -> "++4";
            case "++#1" -> "++#4";
            case "++b2" -> "++#4";
            case "++2" -> "++5";
            case "++#2" -> "++#5";
            case "++b3" -> "++#5";
            case "++3" -> "++6";
            case "++b4" -> "++6";
            case "++4" -> "++#6";
            case "++#3" -> "++#6";
            case "++#4" -> "++7";
            case "++b5" -> "++7";
            case "++5" -> "+++1";
            case "++#5" -> "+++#1";
            case "++b6" -> "+++#1";
            case "++6" -> "+++2";
            case "++#6" -> "+++#2";
            case "++b7" -> "+++#2";
            case "++7" -> "+++3";
            case "+++b1" -> "+++3";
            default -> note;
        };


    }


    private static String cToE(String note) {
        return switch (note) {
            case "--1" -> "--3";
            case "--#1", "--b2" -> "--4";
            case "--2" -> "--#4";
            case "--#2" -> "--5";
            case "--b3" -> "--5";
            case "--3" -> "--#5";
            case "--b4" -> "--#5";
            case "--4" -> "--6";
            case "--#3" -> "--6";
            case "--#4" -> "--#6";
            case "--b5" -> "--#6";
            case "--5" -> "--7";
            case "--#5" -> "-1";
            case "--b6" -> "-1";
            case "--6" -> "-#1";
            case "--#6" -> "-2";
            case "--b7" -> "-2";
            case "--7" -> "-#2";
            case "--b1" -> "-#2";
            case "-1" -> "-3";
            case "-#1" -> "-4";
            case "-b2" -> "-4";
            case "-2" -> "-#4";
            case "-#2" -> "-5";
            case "-b3" -> "-5";
            case "-3" -> "-#5";
            case "-b4" -> "-#5";
            case "-4" -> "-6";
            case "-#3" -> "-6";
            case "-#4" -> "-#6";
            case "-b5" -> "-#6";
            case "-5" -> "-7";
            case "-#5" -> "1";
            case "-b6" -> "1";
            case "-6" -> "#1";
            case "-#6" -> "2";
            case "-b7" -> "2";
            case "-7" -> "#2";
            case "-b1" -> "#2";
            case "1" -> "3";
            case "#1" -> "4";
            case "b2" -> "4";
            case "2" -> "#4";
            case "#2" -> "5";
            case "b3" -> "5";
            case "3" -> "#5";
            case "b4" -> "#5";
            case "4" -> "6";
            case "#3" -> "6";
            case "#4" -> "#6";
            case "b5" -> "#6";
            case "5" -> "7";
            case "#5" -> "+1";
            case "b6" -> "+1";
            case "6" -> "+#1";
            case "#6" -> "+2";
            case "b7" -> "+2";
            case "7" -> "+#2";
            case "+b1" -> "+#2";
            case "+1" -> "+3";
            case "+#1" -> "+4";
            case "+b2" -> "+4";
            case "+2" -> "+#4";
            case "+#2" -> "+5";
            case "+b3" -> "+5";
            case "+3" -> "+#5";
            case "+b4" -> "+#5";
            case "+4" -> "+6";
            case "+#3" -> "+6";
            case "+#4" -> "+#6";
            case "+b5" -> "+#6";
            case "+5" -> "+7";
            case "+#5" -> "++1";
            case "+b6" -> "++1";
            case "+6" -> "++#1";
            case "+#6" -> "++2";
            case "+b7" -> "++2";
            case "+7" -> "++#2";
            case "++b1" -> "++#2";
            case "++1" -> "++3";
            case "++#1" -> "++4";
            case "++b2" -> "++4";
            case "++2" -> "++#4";
            case "++#2" -> "++5";
            case "++b3" -> "++5";
            case "++3" -> "++#5";
            case "++b4" -> "++#5";
            case "++4" -> "++6";
            case "++#3" -> "++6";
            case "++#4" -> "++#6";
            case "++b5" -> "++#6";
            case "++5" -> "++7";
            case "++#5" -> "+++1";
            case "++b6" -> "+++1";
            case "++6" -> "+++#1";
            case "++#6" -> "+++2";
            case "++b7" -> "+++2";
            case "++7" -> "+++#2";
            case "+++b1" -> "+++#2";
            default -> note;
        };
    }

    private static String cToDSharp(String note) {
        return switch (note) {
            case "--1" -> "--#2";
            case "--#1", "--b2" -> "--3";
            case "--2" -> "--4";
            case "--#2" -> "--#4";
            case "--b3" -> "--#4";
            case "--3" -> "--5";
            case "--b4" -> "--5";
            case "--4" -> "--#5";
            case "--#3" -> "--#5";
            case "--#4" -> "--6";
            case "--b5" -> "--6";
            case "--5" -> "--#6";
            case "--#5" -> "--7";
            case "--b6" -> "--7";
            case "--6" -> "-1";
            case "--#6" -> "-#1";
            case "--b7" -> "-#1";
            case "--7" -> "-2";
            case "--b1" -> "-2";
            case "-1" -> "-#2";
            case "-#1" -> "-3";
            case "-b2" -> "-3";
            case "-2" -> "-4";
            case "-#2" -> "-#4";
            case "-b3" -> "-#4";
            case "-3" -> "-5";
            case "-b4" -> "-5";
            case "-4" -> "-#5";
            case "-#3" -> "-#5";
            case "-#4" -> "-6";
            case "-b5" -> "-6";
            case "-5" -> "-#6";
            case "-#5" -> "-7";
            case "-b6" -> "-7";
            case "-6" -> "1";
            case "-#6" -> "#1";
            case "-b7" -> "#1";
            case "-7" -> "2";
            case "-b1" -> "2";
            case "1" -> "#2";
            case "#1" -> "3";
            case "b2" -> "3";
            case "2" -> "4";
            case "#2" -> "#4";
            case "b3" -> "#4";
            case "3" -> "5";
            case "b4" -> "5";
            case "4" -> "#5";
            case "#3" -> "#5";
            case "#4" -> "6";
            case "b5" -> "6";
            case "5" -> "#6";
            case "#5" -> "7";
            case "b6" -> "7";
            case "6" -> "+1";
            case "#6" -> "+#1";
            case "b7" -> "+#1";
            case "7" -> "+2";
            case "+b1" -> "+2";
            case "+1" -> "+#2";
            case "+#1" -> "+3";
            case "+b2" -> "+3";
            case "+2" -> "+4";
            case "+#2" -> "+#4";
            case "+b3" -> "+#4";
            case "+3" -> "+5";
            case "+b4" -> "+5";
            case "+4" -> "+#5";
            case "+#3" -> "+#5";
            case "+#4" -> "+6";
            case "+b5" -> "+6";
            case "+5" -> "+#6";
            case "+#5" -> "+7";
            case "+b6" -> "+7";
            case "+6" -> "++1";
            case "+#6" -> "++#1";
            case "+b7" -> "++#1";
            case "+7" -> "++2";
            case "++b1" -> "++2";
            case "++1" -> "++#2";
            case "++#1" -> "++3";
            case "++b2" -> "++3";
            case "++2" -> "++4";
            case "++#2" -> "++#4";
            case "++b3" -> "++#4";
            case "++3" -> "++5";
            case "++b4" -> "++5";
            case "++4" -> "++#5";
            case "++#3" -> "++#5";
            case "++#4" -> "++6";
            case "++b5" -> "++6";
            case "++5" -> "++#6";
            case "++#5" -> "++7";
            case "++b6" -> "++7";
            case "++6" -> "+++1";
            case "++#6" -> "+++#1";
            case "++b7" -> "+++#1";
            case "++7" -> "+++2";
            case "+++b1" -> "+++2";
            default -> note;
        };
    }


    private static String cToD(String note) {
        return switch (note) {
            case "--1" -> "--2";
            case "--#1", "--b2" -> "--#2";
            case "--2" -> "--3";
            case "--#2" -> "--4";
            case "--b3" -> "--4";
            case "--3" -> "--#4";
            case "--b4" -> "--#4";
            case "--4" -> "--5";
            case "--#3" -> "--5";
            case "--#4" -> "--#5";
            case "--b5" -> "--#5";
            case "--5" -> "--6";
            case "--#5" -> "--#6";
            case "--b6" -> "--#6";
            case "--6" -> "--7";
            case "--#6" -> "-1";
            case "--b7" -> "-1";
            case "--7" -> "-#1";
            case "--b1" -> "-#1";
            case "-1" -> "-2";
            case "-#1" -> "-#2";
            case "-b2" -> "-#2";
            case "-2" -> "-3";
            case "-#2" -> "-4";
            case "-b3" -> "-4";
            case "-3" -> "-#4";
            case "-b4" -> "-#4";
            case "-4" -> "-5";
            case "-#3" -> "-5";
            case "-#4" -> "-#5";
            case "-b5" -> "-#5";
            case "-5" -> "-6";
            case "-#5" -> "-#6";
            case "-b6" -> "-#6";
            case "-6" -> "-7";
            case "-#6" -> "1";
            case "-b7" -> "1";
            case "-7" -> "#1";
            case "-b1" -> "#1";
            case "1" -> "2";
            case "#1" -> "#2";
            case "b2" -> "#2";
            case "2" -> "3";
            case "#2" -> "4";
            case "b3" -> "4";
            case "3" -> "#4";
            case "b4" -> "#4";
            case "4" -> "5";
            case "#3" -> "5";
            case "#4" -> "#5";
            case "b5" -> "#5";
            case "5" -> "6";
            case "#5" -> "#6";
            case "b6" -> "#6";
            case "6" -> "7";
            case "#6" -> "+1";
            case "b7" -> "+1";
            case "7" -> "+#1";
            case "+b1" -> "+#1";
            case "+1" -> "+2";
            case "+#1" -> "+#2";
            case "+b2" -> "+#2";
            case "+2" -> "+3";
            case "+#2" -> "+4";
            case "+b3" -> "+4";
            case "+3" -> "+#4";
            case "+b4" -> "+#4";
            case "+4" -> "+5";
            case "+#3" -> "+5";
            case "+#4" -> "+#5";
            case "+b5" -> "+#5";
            case "+5" -> "+6";
            case "+#5" -> "+#6";
            case "+b6" -> "+#6";
            case "+6" -> "+7";
            case "+#6" -> "++1";
            case "+b7" -> "++1";
            case "+7" -> "++#1";
            case "++b1" -> "++#1";
            case "++1" -> "++2";
            case "++#1" -> "++#2";
            case "++b2" -> "++#2";
            case "++2" -> "++3";
            case "++#2" -> "++4";
            case "++b3" -> "++4";
            case "++3" -> "++#4";
            case "++b4" -> "++#4";
            case "++4" -> "++5";
            case "++#3" -> "++5";
            case "++#4" -> "++#5";
            case "++b5" -> "++#5";
            case "++5" -> "++6";
            case "++#5" -> "++#6";
            case "++b6" -> "++#6";
            case "++6" -> "++7";
            case "++#6" -> "+++1";
            case "++b7" -> "+++1";
            case "++7" -> "+++#1";
            case "+++b1" -> "+++#1";
            default -> note;
        };
    }


    private static String cToCSharp(String note) {
        return switch (note) {
            case "--1" -> "--#1";
            case "--#1", "--b2" -> "--2";
            case "--2" -> "--#2";
            case "--#2" -> "--3";
            case "--b3" -> "--3";
            case "--3" -> "--4";
            case "--b4" -> "--4";
            case "--4" -> "--#4";
            case "--#3" -> "--#4";
            case "--#4" -> "--5";
            case "--b5" -> "--5";
            case "--5" -> "--#5";
            case "--#5" -> "--6";
            case "--b6" -> "--6";
            case "--6" -> "--#6";
            case "--#6" -> "--7";
            case "--b7" -> "--7";
            case "--7" -> "-1";
            case "--b1" -> "-1";
            case "-1" -> "-#1";
            case "-#1" -> "-2";
            case "-b2" -> "-2";
            case "-2" -> "-#2";
            case "-#2" -> "-3";
            case "-b3" -> "-3";
            case "-3" -> "-4";
            case "-b4" -> "-4";
            case "-4" -> "-#4";
            case "-#3" -> "-#4";
            case "-#4" -> "-5";
            case "-b5" -> "-5";
            case "-5" -> "-#5";
            case "-#5" -> "-6";
            case "-b6" -> "-6";
            case "-6" -> "-#6";
            case "-#6" -> "-7";
            case "-b7" -> "-7";
            case "-7" -> "1";
            case "-b1" -> "1";
            case "1" -> "#1";
            case "#1" -> "2";
            case "b2" -> "2";
            case "2" -> "#2";
            case "#2" -> "3";
            case "b3" -> "3";
            case "3" -> "4";
            case "b4" -> "4";
            case "4" -> "#4";
            case "#3" -> "#4";
            case "#4" -> "5";
            case "b5" -> "5";
            case "5" -> "#5";
            case "#5" -> "6";
            case "b6" -> "6";
            case "6" -> "#6";
            case "#6" -> "7";
            case "b7" -> "7";
            case "7" -> "+1";
            case "+b1" -> "+1";
            case "+1" -> "+#1";
            case "+#1" -> "+2";
            case "+b2" -> "+2";
            case "+2" -> "+#2";
            case "+#2" -> "+3";
            case "+b3" -> "+3";
            case "+3" -> "+4";
            case "+b4" -> "+4";
            case "+4" -> "+#4";
            case "+#3" -> "+#4";
            case "+#4" -> "+5";
            case "+b5" -> "+5";
            case "+5" -> "+#5";
            case "+#5" -> "+6";
            case "+b6" -> "+6";
            case "+6" -> "+#6";
            case "+#6" -> "+7";
            case "+b7" -> "+7";
            case "+7" -> "++1";
            case "++b1" -> "++1";
            case "++1" -> "++#1";
            case "++#1" -> "++2";
            case "++b2" -> "++2";
            case "++2" -> "++#2";
            case "++#2" -> "++3";
            case "++b3" -> "++3";
            case "++3" -> "++4";
            case "++b4" -> "++4";
            case "++4" -> "++#4";
            case "++#3" -> "++#4";
            case "++#4" -> "++5";
            case "++b5" -> "++5";
            case "++5" -> "++#5";
            case "++#5" -> "++6";
            case "++b6" -> "++6";
            case "++6" -> "++#6";
            case "++#6" -> "++7";
            case "++b7" -> "++7";
            case "++7" -> "+++1";
            case "+++b1" -> "+++1";
            default -> note;
        };

    }

    //----------------------------------------------------------


    public static void main(String[] args) {
        activate();
    }
}